From: Kent Overstreet <kent.overstreet@gmail.com>
To: Coly Li <colyli@suse.de>
Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
Nix <nix@esperi.org.uk>, Kai Krakow <hurikhan77@gmail.com>,
Eric Wheeler <bcache@lists.ewheeler.net>,
Junhui Tang <tang.junhui@zte.com.cn>,
stable@vger.kernel.org
Subject: Re: [PATCHv2] bcache: option for allow stale data on read failure
Date: Wed, 20 Sep 2017 18:07:35 +0200 [thread overview]
Message-ID: <20170920160735.jp4riq7x3qc472px@kmo-pixel> (raw)
In-Reply-To: <20170919222433.24336-1-colyli@suse.de>
On Wed, Sep 20, 2017 at 06:24:33AM +0800, Coly Li wrote:
> When bcache does read I/Os, for example in writeback or writethrough mode,
> if a read request on cache device is failed, bcache will try to recovery
> the request by reading from cached device. If the data on cached device is
> not synced with cache device, then requester will get a stale data.
>
> For critical storage system like database, providing stale data from
> recovery may result an application level data corruption, which is
> unacceptible. But for some other situation like multi-media stream cache,
> continuous service may be more important and it is acceptible to fetch
> a chunk of stale data.
>
> This patch tries to solve the above conflict by adding a sysfs option
> /sys/block/bcache<idx>/bcache/allow_stale_data_on_failure
> which is defaultly cleared (to 0) as disabled. Now people can make choices
> for different situations.
IMO this is just a bug, I'd rather not have an option to keep the buggy
behaviour. How about this patch:
commit 2746f9c1f962288d8c5d7dabe698bf7b3fddd405
Author: Kent Overstreet <kent.overstreet@gmail.com>
Date: Wed Sep 20 18:06:37 2017 +0200
bcache: Don't recover from IO errors when reading dirty data
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 382397772a..c2d57ef953 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -532,8 +532,10 @@ static int cache_lookup_fn(struct btree_op *op, struct btree *b, struct bkey *k)
PTR_BUCKET(b->c, k, ptr)->prio = INITIAL_PRIO;
- if (KEY_DIRTY(k))
+ if (KEY_DIRTY(k)) {
s->read_dirty_data = true;
+ s->recoverable = false;
+ }
n = bio_next_split(bio, min_t(uint64_t, INT_MAX,
KEY_OFFSET(k) - bio->bi_iter.bi_sector),
next prev parent reply other threads:[~2017-09-20 16:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 22:24 [PATCHv2] bcache: option for allow stale data on read failure Coly Li
2017-09-20 6:59 ` Michael Lyle
2017-09-20 10:28 ` Coly Li
2017-09-20 15:40 ` Michael Lyle
2017-09-20 19:46 ` Coly Li
2017-09-20 16:07 ` Kent Overstreet [this message]
2017-09-20 19:38 ` 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=20170920160735.jp4riq7x3qc472px@kmo-pixel \
--to=kent.overstreet@gmail.com \
--cc=bcache@lists.ewheeler.net \
--cc=colyli@suse.de \
--cc=hurikhan77@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=nix@esperi.org.uk \
--cc=stable@vger.kernel.org \
--cc=tang.junhui@zte.com.cn \
/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