diff mbox series

[v2,1/7] btrfs-progs: mkfs: do not set zone size on non-zoned mode

Message ID 20211005062305.549871-2-naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: use direct-IO for zoned device | expand

Commit Message

Naohiro Aota Oct. 5, 2021, 6:22 a.m. UTC
Since zone_size() returns an emulated zone size even for non-zoned device,
we cannot use cfg.zone_size to determine the device is zoned or not. Set
zone_size = 0 on non-zoned mode.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
 mkfs/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/mkfs/main.c b/mkfs/main.c
index 8a4c9523d601..314d608a5cc5 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1357,7 +1357,10 @@  int BOX_MAIN(mkfs)(int argc, char **argv)
 	mkfs_cfg.features = features;
 	mkfs_cfg.runtime_features = runtime_features;
 	mkfs_cfg.csum_type = csum_type;
-	mkfs_cfg.zone_size = zone_size(file);
+	if (zoned)
+		mkfs_cfg.zone_size = zone_size(file);
+	else
+		mkfs_cfg.zone_size = 0;
 
 	ret = make_btrfs(fd, &mkfs_cfg);
 	if (ret) {