Re: [PATCH v2 01/14] btrfs: don't try to delete RAID stripe-extents if we don't need to

From: Filipe Manana
Date: Thu Jan 09 2025 - 10:15:12 EST


On Thu, Jan 9, 2025 at 2:39 PM Johannes Thumshirn
<Johannes.Thumshirn@xxxxxxx> wrote:
>
> On 09.01.25 13:35, Filipe Manana wrote:
> >> diff --git a/fs/btrfs/tests/raid-stripe-tree-tests.c b/fs/btrfs/tests/raid-stripe-tree-tests.c
> >> index 30f17eb7b6a8a1dfa9f66ed5508da42a70db1fa3..f060c04c7f76357e6d2c6ba78a8ba981e35645bd 100644
> >> --- a/fs/btrfs/tests/raid-stripe-tree-tests.c
> >> +++ b/fs/btrfs/tests/raid-stripe-tree-tests.c
> >> @@ -478,8 +478,9 @@ static int run_test(test_func_t test, u32 sectorsize, u32 nodesize)
> >> ret = PTR_ERR(root);
> >> goto out;
> >> }
> >> - btrfs_set_super_compat_ro_flags(root->fs_info->super_copy,
> >> + btrfs_set_super_incompat_flags(root->fs_info->super_copy,
> >> BTRFS_FEATURE_INCOMPAT_RAID_STRIPE_TREE);
> > This hunk seems unrelated to the rest of the patch, could be fixed in
> > a different patch in case it actually solves any problem (probably
> > not, but it's an incompat feature so it should be changed anyway).
>
> I'll make it a separate patch. RST is an incompat feature not a compat one.
>
> With this patch btrfs_delete_raid_extent() starts checking the incompat
> bit so it is fixing a 'problem'.

Yes, but for that all that's needed is this call:

btrfs_set_fs_incompat(root->fs_info, RAID_STRIPE_TREE);

Right?

Replacing the btrfs_set_super_compat_ro_flags() call with a call to
btrfs_set_super_incompat_flags() shouldn't be needed for this patch.
That's what I was referring to.