[v3,07/27] btrfs: disable tree-log in HMZONED mode
diff mbox series

Message ID 20190808093038.4163421-8-naohiro.aota@wdc.com
State New
Headers show
Series
  • btrfs zoned block device support
Related show

Commit Message

Naohiro Aota Aug. 8, 2019, 9:30 a.m. UTC
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(+)

Patch
diff mbox series

diff --git a/fs/btrfs/hmzoned.c b/fs/btrfs/hmzoned.c
index 0770b1f58bd9..e07e76af1e82 100644
--- a/fs/btrfs/hmzoned.c
+++ b/fs/btrfs/hmzoned.c
@@ -256,5 +256,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;
 }
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 496d8b74f9a2..396238e099bc 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -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