From patchwork Mon Jul 8 02:51:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauricio Faria de Oliveira X-Patchwork-Id: 1128855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45hqk33NRbz9sNF; Mon, 8 Jul 2019 12:52:27 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hkJlP-0000zL-GZ; Mon, 08 Jul 2019 02:52:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hkJlK-0000yU-AM for kernel-team@lists.ubuntu.com; Mon, 08 Jul 2019 02:52:18 +0000 Received: from mail-qk1-f197.google.com ([209.85.222.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hkJlJ-0003Zi-Sx for kernel-team@lists.ubuntu.com; Mon, 08 Jul 2019 02:52:18 +0000 Received: by mail-qk1-f197.google.com with SMTP id d11so6536220qkb.20 for ; Sun, 07 Jul 2019 19:52:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=eHcBIQB6asjuDFDVqRS3ncf2KnE4GuOEYSC6DZIFYUE=; b=HB6sdGxceaiwsWR1xRNB8XsHV5487fPTp+fxwSWsQiS7RY9qj4rS0PPQ+qd58uLRE3 0I3nF7d7bvQhAGIx4qg45iv+wcvISSLkbLS5/cW1s5NCTt7RNP/grrBb3d7vZmyMHy2U im8MCa6G2pwXEOLB37yleWERVZR/WNNSVbaN6cJ3xEn+DhCw0Ma5Vyh1s7VcT1kcRViC JTVxD7BG9B0v9XRdI+abx4GRFNheh8nkMzz9UwadTcfPE4cNtljJnMzjUViqVhWzetkH w5vQBsfrSgnmWbEzcjMmit9/Bx/1q8azOnTxoY3m+/fSE3fa7p0po5uFAhdjHWwHorpf w7ew== X-Gm-Message-State: APjAAAUAYRsdrmxJyEvEVb7Wna5LLQI1Orkgypy2nvphgEDC4E5xHhwQ l7u90lk/+Aa8nLJ0upCfN8FEPYEx0dhPWiqr8wCB41DHOjlIflRTVP+aJP9xvTcU6b1tzMxphFL l7sLyamnq9ljdJX47CHWnpW5sZNFGN5kkwboHet1qgQ== X-Received: by 2002:ac8:6747:: with SMTP id n7mr12214827qtp.19.1562554336986; Sun, 07 Jul 2019 19:52:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqSKGtvvrPHpo4eP2//EozlCul49ZKmOOxV5xwtthKeXGyeBn2hJKzRLDn9ryOKdX1TCYvaA== X-Received: by 2002:ac8:6747:: with SMTP id n7mr12214821qtp.19.1562554336812; Sun, 07 Jul 2019 19:52:16 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:4e7:1017:3da7:3d04:ea25:3a0]) by smtp.gmail.com with ESMTPSA id c4sm7300354qkd.24.2019.07.07.19.52.15 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 07 Jul 2019 19:52:16 -0700 (PDT) From: Mauricio Faria de Oliveira To: kernel-team@lists.ubuntu.com Subject: [D/E][PATCH 1/1] Revert "bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()" Date: Sun, 7 Jul 2019 23:51:31 -0300 Message-Id: <20190708025131.15963-2-mfo@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708025131.15963-1-mfo@canonical.com> References: <20190708025131.15963-1-mfo@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Coly Li BugLink: https://bugs.launchpad.net/bugs/1829563 This reverts commit 6147305c73e4511ca1a975b766b97a779d442567. Although this patch helps the failed bcache device to stop faster when too many I/O errors detected on corresponding cached device, setting CACHE_SET_IO_DISABLE bit to cache set c->flags was not a good idea. This operation will disable all I/Os on cache set, which means other attached bcache devices won't work neither. Without this patch, the failed bcache device can also be stopped eventually if internal I/O accomplished (e.g. writeback). Therefore here I revert it. Fixes: 6147305c73e4 ("bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()") Reported-by: Yong Li Signed-off-by: Coly Li Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe (cherry picked from commit 695277f16b3a102fcc22c97fdf2de77c7b19f0b3 linux-next) Signed-off-by: Mauricio Faria de Oliveira Acked-by: Connor Kuehl --- drivers/md/bcache/super.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 169a959593e4..97db3daf3a77 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1436,8 +1436,6 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size) bool bch_cached_dev_error(struct cached_dev *dc) { - struct cache_set *c; - if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags)) return false; @@ -1448,21 +1446,6 @@ bool bch_cached_dev_error(struct cached_dev *dc) pr_err("stop %s: too many IO errors on backing device %s\n", dc->disk.disk->disk_name, dc->backing_dev_name); - /* - * If the cached device is still attached to a cache set, - * even dc->io_disable is true and no more I/O requests - * accepted, cache device internal I/O (writeback scan or - * garbage collection) may still prevent bcache device from - * being stopped. So here CACHE_SET_IO_DISABLE should be - * set to c->flags too, to make the internal I/O to cache - * device rejected and stopped immediately. - * If c is NULL, that means the bcache device is not attached - * to any cache set, then no CACHE_SET_IO_DISABLE bit to set. - */ - c = dc->disk.c; - if (c && test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags)) - pr_info("CACHE_SET_IO_DISABLE already set"); - bcache_device_stop(&dc->disk); return true; }