Skip to content

Commit a589dde

Browse files
naotakdave
authored andcommitted
btrfs: disallow mixed-bg in ZONED mode
Placing both data and metadata in a block group is impossible in ZONED mode. For data, we can allocate a space for it and write it immediately after the allocation. For metadata, however, we cannot do that, because the logical addresses are recorded in other metadata buffers to build up the trees. As a result, a data buffer can be placed after a metadata buffer, which is not written yet. Writing out the data buffer will break the sequential write rule. Check and disallow MIXED_BG with ZONED mode. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Anand Jain <anand.jain@oracle.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>
1 parent f1569c4 commit a589dde

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fs/btrfs/zoned.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
252252
goto out;
253253
}
254254

255+
if (btrfs_fs_incompat(fs_info, MIXED_GROUPS)) {
256+
btrfs_err(fs_info, "zoned: mixed block groups not supported");
257+
ret = -EINVAL;
258+
goto out;
259+
}
260+
255261
fs_info->zone_size = zone_size;
256262
fs_info->max_zone_append_size = max_zone_append_size;
257263

0 commit comments

Comments
 (0)