From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 165BBC76194 for ; Thu, 25 Jul 2019 05:50:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DED5820828 for ; Thu, 25 Jul 2019 05:50:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033838; bh=r662jml85MiQMgRGSEkOVO10RYOobqyOSejyrb8hO7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y2dPLDhg4Q8ifITY7AlVIVcyjEaU7EcZRb6gu1S6+rmmzEmhKqATiG10yAN1SkcsF RZEJ0FVBvKIGRCgATt1RTjkb2xHz5uxbFTkV5vGl7469tq/Os2gVys0QP7vi+KKnGW irtkYQekExsCm52GFLLmqTIHp08g6KBekmoQi7dI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390927AbfGYFmo (ORCPT ); Thu, 25 Jul 2019 01:42:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:57680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390887AbfGYFmn (ORCPT ); Thu, 25 Jul 2019 01:42:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A38D121850; Thu, 25 Jul 2019 05:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033363; bh=r662jml85MiQMgRGSEkOVO10RYOobqyOSejyrb8hO7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tTdzPUvrHGzh1PKYjiFIfL1KSKAe8If1EM6lk7j4NzLjOzlcJKeF1L5hRi87VTWAk okUXOD39RFhQTM0LGRx0/UQTKvFrDebDPlmE6v1lq/jNueSkzYO5NMv1hc1zRknwLU xXKAyM2sv7kRnEIR10zEk4ItBeR11Dih5rG9UGgY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yong Li , Coly Li , Jens Axboe Subject: [PATCH 4.19 183/271] Revert "bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()" Date: Wed, 24 Jul 2019 21:20:52 +0200 Message-Id: <20190724191710.824018675@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Coly Li commit 695277f16b3a102fcc22c97fdf2de77c7b19f0b3 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/md/bcache/super.c | 17 ----------------- 1 file changed, 17 deletions(-) --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1423,8 +1423,6 @@ int bch_flash_dev_create(struct cache_se 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; @@ -1435,21 +1433,6 @@ bool bch_cached_dev_error(struct cached_ 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; }