]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
btrfs: zoned: do not select metadata BG as finish target
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 16 Jul 2025 07:59:52 +0000 (16:59 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Aug 2025 15:07:16 +0000 (17:07 +0200)
We call btrfs_zone_finish_one_bg() to zone finish one block group and make
room to activate another block group. Currently, we can choose a metadata
block group as a target. But, as we reserve an active metadata block group,
we no longer want to select a metadata block group. So, skip it in the
loop.

CC: stable@vger.kernel.org # 6.6+
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/zoned.c

index 245e813ecd785a337dbfa5384634e3f4cb864ad2..db11b5b5f0e66939363200bf7f6ffcae43deb74c 100644 (file)
@@ -2650,7 +2650,7 @@ int btrfs_zone_finish_one_bg(struct btrfs_fs_info *fs_info)
 
                spin_lock(&block_group->lock);
                if (block_group->reserved || block_group->alloc_offset == 0 ||
-                   (block_group->flags & BTRFS_BLOCK_GROUP_SYSTEM) ||
+                   !(block_group->flags & BTRFS_BLOCK_GROUP_DATA) ||
                    test_bit(BLOCK_GROUP_FLAG_ZONED_DATA_RELOC, &block_group->runtime_flags)) {
                        spin_unlock(&block_group->lock);
                        continue;