Thread (13 messages) 13 messages, 2 authors, 2021-10-20
STALE1709d REVIEWED: 1 (0M)
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

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

From: Naohiro Aota <naohiro.aota@wdc.com>
Date: 2021-10-05 06:23:35
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
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 --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) {
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help