From: Michael Lyle <mlyle@lyle.org>
To: Rui Hua <huarui.dev@gmail.com>
Cc: Coly Li <i@coly.li>, Kent Overstreet <kent.overstreet@gmail.com>,
linux-bcache <linux-bcache@vger.kernel.org>,
linux-block@vger.kernel.org
Subject: Re: [PATCH] bcache: recover data from backing device when read request hit clean
Date: Tue, 21 Nov 2017 21:13:52 -0800 [thread overview]
Message-ID: <8cb4231f-9b0d-3cb3-d733-b868f37daa6d@lyle.org> (raw)
In-Reply-To: <CAJ+L6qen=5AVFr_q_r_F6jU8BTQ=t+7p94ucFW9HXEDD6AGEKg@mail.gmail.com>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Please note though, that your patches have all tabs expanded to spaces,
which makes them difficult to apply. I have fixed things these times
but please try to submit them in correct form in the future.
Thanks,
Mike
On 11/17/2017 04:57 PM, Michael Lyle wrote:
> Rui Hua--
>
> Thanks for the clarification. You're correct, it doesn't get called,
> and it goes to read_complete. However, read_error should probably get
> called. How would you suggest handling this-- should we initially set
> read_dirty_data true and clear it if it is all clean? (and change the
> condition to properly go into the error path). As it is, the patch
> makes things no worse but the error path is very unsafe.
>
> Mike
>
> On Thu, Nov 16, 2017 at 8:25 PM, Rui Hua <huarui.dev@gmail.com> wrote:
>> Hi, Michael--
>>
>> Thanks for the quickly reply.
>>
>> If the metadata on the cache device was NOT correctly read,
>> cached_dev_read_error() will not be called, so the recovery check will
>> not be executed. so this patch is safe.
>> s->iop.error was not set when faild to read metadata on the cache
>> device, so the cached_dev_bio_complete() will be called instead of
>> cached_dev_read_error()
>>
>> 2017-11-17 12:02 GMT+08:00 Michael Lyle <mlyle@lyle.org>:
>>> Hi, Rui Hua--
>>>
>>> On 11/16/2017 07:51 PM, Rui Hua wrote:
>>>> In this patch, we use s->read_dirty_data to judge whether the read
>>>> request hit dirty data in cache device, it is safe to reread data from
>>>> the backing device when the read request hit clean data. This can not
>>>> only handle cache read race, but also recover data when failed read
>>>> request from cache device.
>>>
>>> I haven't read over all of this yet, to understand the read race. But
>>> this change can't be safe-- read_dirty_data only is set to true if the
>>> metadata on the cache device is correctly read. If that fails, the flag
>>> may not be set and we could read stale data on the backing device.
>>>
>>> Mike
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2017-11-22 5:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 3:51 [PATCH] bcache: recover data from backing device when read request hit clean Rui Hua
2017-11-17 4:02 ` Michael Lyle
2017-11-17 4:25 ` Rui Hua
2017-11-18 0:57 ` Michael Lyle
2017-11-18 17:00 ` Rui Hua
2017-11-22 5:13 ` Michael Lyle [this message]
2017-11-22 6:04 ` Rui Hua
2017-11-23 15:09 ` Eddie Chapman
2017-11-23 16:31 ` Coly Li
2017-11-23 18:08 ` Eddie Chapman
2017-11-24 12:50 ` Rui Hua
2017-11-17 6:01 ` Coly Li
2017-11-17 7:26 ` Rui Hua
[not found] ` <D393CD04-8C7A-4A8C-B23A-6C68D5544E34@profihost.ag>
2017-11-17 10:20 ` Rui Hua
2017-11-17 12:38 ` Stefan Priebe - Profihost AG
2017-11-17 12:57 ` Eddie Chapman
2017-11-17 13:22 ` Coly Li
2017-11-17 13:43 ` Eddie Chapman
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=8cb4231f-9b0d-3cb3-d733-b868f37daa6d@lyle.org \
--to=mlyle@lyle.org \
--cc=huarui.dev@gmail.com \
--cc=i@coly.li \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@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