@@ -253,5 +253,11 @@ int btrfs_check_mountopts_hmzoned(struct btrfs_fs_info *info)
return -EINVAL;
}
+ if (!btrfs_test_opt(info, NOTREELOG)) {
+ btrfs_err(info,
+ "cannot enable tree log with HMZONED mode");
+ return -EINVAL;
+ }
+
return 0;
}
@@ -447,6 +447,10 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
btrfs_set_opt(info->mount_opt, SPACE_CACHE);
}
+ if (btrfs_fs_incompat(info, HMZONED))
+ btrfs_set_and_info(info, NOTREELOG,
+ "disabling tree log with HMZONED mode");
+
/*
* Even the options are empty, we still need to do extra check
* against new flags
Extent buffers for tree-log tree are allocated scattered between other metadata's extent buffers, and btrfs_sync_log() writes out only the tree-log buffers. This behavior breaks sequential writing rule, which is mandatory in sequential required zones. Actually, we don't have much benefit using tree-logging with HMZONED mode, until we can allocate tree-log buffer sequentially. So, disable tree-log entirely in HMZONED mode. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> --- fs/btrfs/hmzoned.c | 6 ++++++ fs/btrfs/super.c | 4 ++++ 2 files changed, 10 insertions(+)