Skip to content

Commit 5906333

Browse files
morbidrsakdave
authored andcommitted
btrfs: zoned: don't skip block group profile checks on conventional zones
On a zoned filesystem with conventional zones, we're skipping the block group profile checks for the conventional zones. This allows converting a zoned filesystem's data block groups to RAID when all of the zones backing the chunk are on conventional zones. But this will lead to problems, once we're trying to allocate chunks backed by sequential zones. So also check for conventional zones when loading a block group's profile on them. Reported-by: HAN Yuwei <hrx@bupt.moe> Link: https://lore.kernel.org/all/1ACD2E3643008A17+da260584-2c7f-432a-9e22-9d390aae84cc@bupt.moe/#t Reviewed-by: Boris Burkov <boris@bur.io> Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent b0ad381 commit 5906333

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/btrfs/zoned.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,15 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
16561656
}
16571657

16581658
out:
1659+
/* Reject non SINGLE data profiles without RST */
1660+
if ((map->type & BTRFS_BLOCK_GROUP_DATA) &&
1661+
(map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) &&
1662+
!fs_info->stripe_root) {
1663+
btrfs_err(fs_info, "zoned: data %s needs raid-stripe-tree",
1664+
btrfs_bg_type_to_raid_name(map->type));
1665+
return -EINVAL;
1666+
}
1667+
16591668
if (cache->alloc_offset > cache->zone_capacity) {
16601669
btrfs_err(fs_info,
16611670
"zoned: invalid write pointer %llu (larger than zone capacity %llu) in block group %llu",

0 commit comments

Comments
 (0)