From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Naohiro Aota <Naohiro.Aota@wdc.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: new scrub code vs zoned file systems
Date: Thu, 1 Jun 2023 13:00:40 +0800 [thread overview]
Message-ID: <dcc61893-c48d-e8d9-3161-7f7b965b8e8b@gmx.com> (raw)
In-Reply-To: <20230601044034.GA21827@lst.de>
On 2023/6/1 12:40, Christoph Hellwig wrote:
> On Thu, Jun 01, 2023 at 10:09:24AM +0800, Qu Wenruo wrote:
>> So far the various wrapper around the write operations work as expected,
>> and hide the detailed well enough that most of us didn't even notice.
>>
>> E.g. all the zoned code is already handled in scrub_write_sectors().
>>
>> The crash itself is caused by the fact that end io part is relying on
>> the inode pointer, that itself is a simple fix.
>
> But the reason why it is relying on the inode pointer is that it needs
> to record the actual written LBA after I/O completion. So it's not
> just a case of just add a NULL check, it needs a way to adjust the
> logical to physical mapping from the dummy added before the I/O.
That's all handled by scrub.
For scrub we're doing the writes just like metadata, with QD=1, aka,
always write and wait (and know where the write would land), and for the
gaps we would call fill_writer_pointer_gap() to fill them.
Thus we don't need to do any adjustment (unless you're talking about
RST, but I believe that's a different beast).
>
>> But I'm more concerned about why we have a full zone before that crash.
>
> I think this is happening because we can't account for the zone filling
> without the proper context.
I believe it's a different problem, maybe some de-sync between scrub
write_pointer and the real zoned pointer inside the device.
My current guess is, the target zone inside the target device is not
properly reset before dev-replace.
Thanks,
Qu
>
>>> b) don't create a new relocation thread per zone, but run it from
>>> the scrub context.
>>>
>>
>> That's a little too complex, the problem is that relocation is a
>> completely different beast, too different from the scrub code.
>>
>> But I agree the repair part for zoned needs some rework, it's not
>> working from the day 1 of zoned support, but shouldn't need that a huge
>> change.
>>
>> E.g. we just record that we need to relocate the bg, then after the
>> scrub of that bg is fully finished, queue a relocation for it.
>
> Yes. That's what the read repair already does, and also the scrub
> code, although in a somewhat sub-optimal way.
>
>>
>> Thanks,
>> Qu
> ---end quoted text---
next prev parent reply other threads:[~2023-06-01 5:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 12:52 new scrub code vs zoned file systems Christoph Hellwig
2023-05-31 13:10 ` Johannes Thumshirn
2023-05-31 13:20 ` Christoph Hellwig
2023-05-31 13:25 ` Johannes Thumshirn
2023-05-31 13:30 ` Christoph Hellwig
2023-05-31 14:04 ` Johannes Thumshirn
2023-05-31 14:17 ` Christoph Hellwig
2023-06-01 2:09 ` Qu Wenruo
2023-06-01 4:40 ` Christoph Hellwig
2023-06-01 5:00 ` Qu Wenruo [this message]
2023-06-01 5:17 ` Naohiro Aota
2023-06-01 5:21 ` Naohiro Aota
2023-06-01 7:21 ` Qu Wenruo
2023-06-01 7:27 ` Christoph Hellwig
2023-06-01 8:46 ` Qu Wenruo
2023-06-01 5:22 ` Christoph Hellwig
2023-06-01 5:34 ` Christoph Hellwig
2023-06-01 5:45 ` Qu Wenruo
2023-06-01 5:47 ` Christoph Hellwig
2023-05-31 22:25 ` Qu Wenruo
2023-05-31 22:48 ` Qu Wenruo
2023-06-01 4:53 ` Christoph Hellwig
2023-06-01 5:04 ` Qu Wenruo
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=dcc61893-c48d-e8d9-3161-7f7b965b8e8b@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=hch@lst.de \
--cc=linux-btrfs@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