Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10727907ybi; Thu, 25 Jul 2019 04:19:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw2rCFlJjZAqOmH5n99q0sB0AfaP4NCNO9ET41o/38DDlvUB5gpwR6B0Fdn6kI4ZelOcUN X-Received: by 2002:a63:784c:: with SMTP id t73mr88276553pgc.268.1564053594038; Thu, 25 Jul 2019 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564053594; cv=none; d=google.com; s=arc-20160816; b=wqkwYE0rse7q6S9gWDy/ez/PwpeDUa2mNWZmUYfdOgSHC0r7/Ob3w0cJSFEh48hqeG b9qvDkDmOoWfyNBb5wKEK0ggc26J+DSTaqBapMoIh000viVGiWvVxbgGVSxtI612xsqU GFMKGzPLpRUTIjSw3O2qOf5KqUEGFbBztHTPekK8cxDF4XbFA5Ji5PuSHBMg2CDtMC1y nVCZnlkkfXHoGfVCtX1/TAS9lw4zSKbsM6R0UGUjqt7UMM+EI+UmapAppnFzKEnGaRBX JkQ5qKFLqegpY6LHF544mKLq3NV98c+8kxDdBp9lvyml8tj3WhzAKxC7R10TrZwKm3Qe MRVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fZC8meFWjonvJwk+ZAoz4GWUpbiu7i6ds2LucSoNmsU=; b=SmYtijHLKkYZJ1MMspUKboW+ZcpXwU7IS993a3Xi8qumI1XfA7iq5YFGMfRNx3RRWb mMTpArZFPTULZ6p4+RYo7/H8Id8a6scDi6VHH6aVHdZG3TCU6yTnFL1u9CKDFI/eFmCc X6d65RDbAuoRnGhrgPTzloDBbx3Zfy+tLWzETon35wdczinH84gzKRrqWv1qsqfIsbzP IeqW9IZ/WKiuKbWFZFpwOkpL5rG7Uo0ZEiVrE+IUtZmVgeMErBTzwkxeRdrtkxyrWr9p 4KRjPthhG+e3NBl0jUg0b/FmTUDCbKAlmGGJMyThBo+2xWf5oxqF8SqB8jBhY1kGU4Yo iyUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tTdzPUvr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si22177981pgj.216.2019.07.25.04.19.34; Thu, 25 Jul 2019 04:19:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tTdzPUvr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390936AbfGYFmp (ORCPT + 99 others); Thu, 25 Jul 2019 01:42:45 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; }