Merge tag 'for-6.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[sfrench/cifs-2.6.git] / fs / btrfs / zoned.c
index 3a5d69ff25fc221f20c1e37a9854021eff246bad..5f750fa53a2b2a88c81e9ec05c9a7ab22d44a674 100644 (file)
@@ -1639,6 +1639,15 @@ int btrfs_load_block_group_zone_info(struct btrfs_block_group *cache, bool new)
        }
 
 out:
+       /* Reject non SINGLE data profiles without RST */
+       if ((map->type & BTRFS_BLOCK_GROUP_DATA) &&
+           (map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) &&
+           !fs_info->stripe_root) {
+               btrfs_err(fs_info, "zoned: data %s needs raid-stripe-tree",
+                         btrfs_bg_type_to_raid_name(map->type));
+               return -EINVAL;
+       }
+
        if (cache->alloc_offset > cache->zone_capacity) {
                btrfs_err(fs_info,
 "zoned: invalid write pointer %llu (larger than zone capacity %llu) in block group %llu",