From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Johannes Thumshirn <jth@kernel.org>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Filipe Manana <fdmanana@suse.com>,
Damien Le Moal <dlemoal@kernel.org>,
David Sterba <dsterba@suse.com>,
Naohiro Aota <Naohiro.Aota@wdc.com>,
Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH v4] btrfs: zoned: reserve data_reloc block group on mount
Date: Tue, 3 Jun 2025 18:17:08 +0000 [thread overview]
Message-ID: <7ab34e96-ff95-47d5-ba09-e235fb708a4b@wdc.com> (raw)
In-Reply-To: <CAL3q7H7OOQF_VgBHtJ4iPHQ8Fbn=gu4-Wgb6Kn33PBoijwrS6g@mail.gmail.com>
On 03.06.25 16:07, Filipe Manana wrote:
> On Tue, Jun 3, 2025 at 12:23 PM Johannes Thumshirn
> <Johannes.Thumshirn@wdc.com> wrote:
>>
>> On 03.06.25 08:14, Johannes Thumshirn wrote:
>>> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>>
>>> Create a block group dedicated for data relocation on mount of a zoned
>>> filesystem.
>>>
>>> If there is already more than one empty DATA block group on mount, this
>>> one is picked for the data relocation block group, instead of a newly
>>> created one.
>>>
>>> This is done to ensure, there is always space for performing garbage
>>> collection and the filesystem is not hitting ENOSPC under heavy overwrite
>>> workloads.
>>>
>>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>> Reviewed-by: Filipe Manana <fdmanana@suse.com>
>>
>> Unfortunately this can result in a FS corruption if the accompanying
>> mkfs patch is not applied.
>>
>> I think it is, because I'm not waiting for the transaction to be written
>> out in case we need to allocate a chunk. Therefor metadata on DUP can
>> get out of sync somehow when one copy is on a sequential zone and one on
>> a conventional zone.
>
> Not familiar with the zone specific problems, but in order to use a
> new chunk, there's no need to commit a transaction.
> And if for some weird reason that is a problem for the zoned case, how
> about committing the transaction after allocating the chunk? Does it
> still cause any issue?
AFAICT yes. And it's a very wired case that only happens on DUP metadata
and the metadata bg has to be backed by a conventional and a sequential
zone.
The problem is, every hypothesis I have how this could happen is
invalidated by looking at the code. Basically what must happen is that
more than one chunk is created backed by the same zone, which according
to the code can't happen.
prev parent reply other threads:[~2025-06-03 18:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 6:14 [PATCH v4] btrfs: zoned: reserve data_reloc block group on mount Johannes Thumshirn
2025-06-03 11:22 ` Johannes Thumshirn
2025-06-03 14:06 ` Filipe Manana
2025-06-03 18:17 ` Johannes Thumshirn [this message]
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=7ab34e96-ff95-47d5-ba09-e235fb708a4b@wdc.com \
--to=johannes.thumshirn@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=dlemoal@kernel.org \
--cc=dsterba@suse.com \
--cc=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--cc=josef@toxicpanda.com \
--cc=jth@kernel.org \
--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