All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs:  default to SINGLE profile on zoned devices
@ 2021-07-06  9:19 Johannes Thumshirn
  2021-07-06 13:41 ` Nikolay Borisov
  2021-07-07 14:50 ` David Sterba
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2021-07-06  9:19 UTC (permalink / raw)
  To: David Sterba; +Cc: Johannes Thumshirn, linux-btrfs, Damien Le Moal

On zoned devices we're currently not supporting any other block group
profile than the SINGLE profile, so pick it as default value otherwise a
user would have to specify it manually at mkfs time for rotational zoned
devices.

Reported-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 mkfs/common.h | 2 ++
 mkfs/main.c   | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/mkfs/common.h b/mkfs/common.h
index ea87c3cabccf..cd98c3717235 100644
--- a/mkfs/common.h
+++ b/mkfs/common.h
@@ -34,9 +34,11 @@
 #define BTRFS_MKFS_DEFAULT_DATA_ONE_DEVICE	0	/* SINGLE */
 #define BTRFS_MKFS_DEFAULT_META_ONE_DEVICE	BTRFS_BLOCK_GROUP_DUP
 #define BTRFS_MKFS_DEFAULT_META_ONE_DEVICE_SSD	0	/* SINGLE */
+#define BTRFS_MKFS_DEFAULT_META_ONE_DEVICE_ZONED 0	/* SINGLE */
 
 #define BTRFS_MKFS_DEFAULT_DATA_MULTI_DEVICE	0	/* SINGLE */
 #define BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE	BTRFS_BLOCK_GROUP_RAID1
+#define BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE_ZONED 0	/* SINGLE */
 
 struct btrfs_trans_handle;
 struct btrfs_root;
diff --git a/mkfs/main.c b/mkfs/main.c
index d2322fafc862..fb68136a8389 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1149,10 +1149,15 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 				"force metadata duplication.\n");
 
 			if (dev_cnt > 1) {
-				tmp = BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE;
+				if (zoned)
+					tmp = BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE_ZONED;
+				else
+					tmp = BTRFS_MKFS_DEFAULT_META_MULTI_DEVICE;
 			} else {
 				if (ssd)
 					tmp = BTRFS_MKFS_DEFAULT_META_ONE_DEVICE_SSD;
+				else if (zoned)
+					tmp = BTRFS_MKFS_DEFAULT_META_ONE_DEVICE_ZONED;
 				else
 					tmp = BTRFS_MKFS_DEFAULT_META_ONE_DEVICE;
 			}
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-30 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06  9:19 [PATCH] btrfs-progs: default to SINGLE profile on zoned devices Johannes Thumshirn
2021-07-06 13:41 ` Nikolay Borisov
2021-07-07 14:50 ` David Sterba
2021-07-07 15:01   ` Johannes Thumshirn
2021-07-12 19:16     ` Johannes Thumshirn
2021-07-30 14:09       ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.