From: Qu Wenruo <wqu@suse.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Qu Wenruo <quwenruo.btrfs@gmx.com>,
Johannes Thumshirn <jth@kernel.org>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH 2/2] btrfs: replace stripe extents
Date: Tue, 9 Jul 2024 17:16:14 +0930 [thread overview]
Message-ID: <bca6a8d7-b23e-49be-9cfa-f387aca82e60@suse.com> (raw)
In-Reply-To: <09f08d98-a615-4952-9949-daf4a7119b96@wdc.com>
在 2024/7/9 17:00, Johannes Thumshirn 写道:
> On 09.07.24 09:18, Qu Wenruo wrote:
>>
>>
>> 在 2024/7/9 16:02, Johannes Thumshirn 写道:
>>> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>>
>>> Update stripe extents in case a write to an already existing address
>>> incoming.
>>>
>>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>>
>> Looks good to me.
>>
>> Reviewed-by: Qu Wenruo <wqu@suse.com>
>>
>> But still as I mentioned in the original thread, I'm wondering why
>> dev-replace of RST needs to update RST entry.
>>
>> I'd prefer to do a dev-extent level copy so that no RST/chunk needs to
>> be updated, just like what we did for non-RST cases.
>>
>> But so far the change should be good enough for us to continue the testing.
>
> I /think/ I have a fix for the ASSERT() as well. It survived btrfs/060
> once already (which it hasn't before) and it's trivial and I feel stupid
> for it:
Wow, it's indeed a little embarrassing, but I'm still a little confused.
>
> diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c
> index fd56535b2289..6b1c6004f94c 100644
> --- a/fs/btrfs/raid-stripe-tree.c
> +++ b/fs/btrfs/raid-stripe-tree.c
> @@ -57,6 +57,9 @@ int btrfs_delete_raid_extent(struct btrfs_trans_handle
> *trans, u64 start, u64 le
> /* That stripe ends before we start, we're done. */
Didn't all the btrfs_delete_raid_extent() callers expects to delete
exact the range? Thus I though we should always hit 0 from
btrfs_search_slot().
> if (found_end <= start)
> break;
> + /* That stripe starts after we end, we're done as well */
> + if (found_start >= end)
> + break;
Another thing is, just to be safer, you may want to do the RST entry
search using key.offset = 0 or key.offset = -1, instead of an exact search.
The key.offset == 0 search example can be found in scrub_enumerate_chunk().
And the key.offset == -1 search example can be found in
btrfs_free_dev_extent().
And do extra length check to ensure we always hit an exact match.
Thanks,
Qu
>
> trace_btrfs_raid_extent_delete(fs_info, start, end,
> found_start, found_end);
>
next prev parent reply other threads:[~2024-07-09 7:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 6:32 [PATCH 0/2] btrfs: more RAID stripe tree updates Johannes Thumshirn
2024-07-09 6:32 ` [PATCH 1/2] btrfs: don't hold dev_replace rwsem over whole of btrfs_map_block Johannes Thumshirn
2024-07-09 6:32 ` [PATCH 2/2] btrfs: replace stripe extents Johannes Thumshirn
2024-07-09 7:18 ` Qu Wenruo
2024-07-09 7:30 ` Johannes Thumshirn
2024-07-09 7:46 ` Qu Wenruo [this message]
2024-07-09 8:44 ` Johannes Thumshirn
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=bca6a8d7-b23e-49be-9cfa-f387aca82e60@suse.com \
--to=wqu@suse.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=josef@toxicpanda.com \
--cc=jth@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.com \
/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
all inboxes | Powered by JetHome®