From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>,
stable@vger.kernel.org
Subject: [PATCH 03/15] bcache: ignore read-ahead request failure on backing device
Date: Tue, 4 Jun 2019 23:16:12 +0800 [thread overview]
Message-ID: <20190604151624.105150-4-colyli@suse.de> (raw)
In-Reply-To: <20190604151624.105150-1-colyli@suse.de>
When md raid device (e.g. raid456) is used as backing device, read-ahead
requests on a degrading and recovering md raid device might be failured
immediately by md raid code, but indeed this md raid array can still be
read or write for normal I/O requests. Therefore such failed read-ahead
request are not real hardware failure. Further more, after degrading and
recovering accomplished, read-ahead requests will be handled by md raid
array again.
For such condition, I/O failures of read-ahead requests don't indicate
real health status (because normal I/O still be served), they should not
be counted into I/O error counter dc->io_errors.
Since there is no simple way to detect whether the backing divice is a
md raid device, this patch simply ignores I/O failures for read-ahead
bios on backing device, to avoid bogus backing device failure on a
degrading md raid array.
Suggested-and-tested-by: Thorsten Knabe <linux@thorsten-knabe.de>
Signed-off-by: Coly Li <colyli@suse.de>
Cc: stable@vger.kernel.org
---
drivers/md/bcache/io.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
index c25097968319..4d93f07f63e5 100644
--- a/drivers/md/bcache/io.c
+++ b/drivers/md/bcache/io.c
@@ -58,6 +58,18 @@ void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio)
WARN_ONCE(!dc, "NULL pointer of struct cached_dev");
+ /*
+ * Read-ahead requests on a degrading and recovering md raid
+ * (e.g. raid6) device might be failured immediately by md
+ * raid code, which is not a real hardware media failure. So
+ * we shouldn't count failed REQ_RAHEAD bio to dc->io_errors.
+ */
+ if (bio->bi_opf & REQ_RAHEAD) {
+ pr_warn_ratelimited("%s: Read-ahead I/O failed on backing device, ignore",
+ dc->backing_dev_name);
+ return;
+ }
+
errors = atomic_add_return(1, &dc->io_errors);
if (errors < dc->error_limit)
pr_err("%s: IO error on backing device, unrecoverable",
--
2.16.4
next prev parent reply other threads:[~2019-06-04 15:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 15:16 [PATCH 00/15] bcache fixes before Linux v5.3 Coly Li
2019-06-04 15:16 ` [PATCH 01/15] Revert "bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()" Coly Li
2019-06-04 15:16 ` [PATCH 02/15] bcache: avoid flushing btree node in cache_set_flush() if io disabled Coly Li
2019-06-04 15:16 ` Coly Li [this message]
2019-06-04 15:16 ` [PATCH 04/15] bcache: add io error counting in write_bdev_super_endio() Coly Li
2019-06-04 15:16 ` [PATCH 05/15] bcache: remove "XXX:" comment line from run_cache_set() Coly Li
2019-06-04 15:16 ` [PATCH 06/15] bcache: remove unnecessary prefetch() in bset_search_tree() Coly Li
2019-06-04 15:16 ` [PATCH 07/15] bcache: use sysfs_match_string() instead of __sysfs_match_string() Coly Li
2019-06-04 15:16 ` [PATCH 08/15] bcache: add return value check to bch_cached_dev_run() Coly Li
2019-06-04 15:16 ` [PATCH 09/15] bcache: remove unncessary code in bch_btree_keys_init() Coly Li
2019-06-04 15:16 ` [PATCH 10/15] bcache: check CACHE_SET_IO_DISABLE in allocator code Coly Li
2019-06-04 15:16 ` [PATCH 11/15] bcache: check CACHE_SET_IO_DISABLE bit in bch_journal() Coly Li
2019-06-04 15:16 ` [PATCH 12/15] bcache: more detailed error message to bcache_device_link() Coly Li
2019-06-04 15:16 ` [PATCH 13/15] bcache: add more error message in bch_cached_dev_attach() Coly Li
2019-06-04 15:16 ` [PATCH 14/15] bcache: shrink btree node cache after bch_btree_check() Coly Li
2019-06-04 15:16 ` [PATCH 15/15] bcache: improve error message in bch_cached_dev_run() Coly Li
2019-06-04 15:53 ` [PATCH 16/18] bcache: only set BCACHE_DEV_WB_RUNNING when cached device attached Coly Li
2019-06-04 15:53 ` [PATCH 17/18] bcache: make bset_search_tree() be more understandable Coly Li
2019-06-05 5:43 ` Christoph Hellwig
2019-06-05 5:45 ` Coly Li
2019-06-04 15:53 ` [PATCH 18/18] bcache: add code comments for journal_read_bucket() Coly Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190604151624.105150-4-colyli@suse.de \
--to=colyli@suse.de \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).