All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: David Sterba <dsterba@suse.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-btrfs@vger.kernel.org,
	Damien Le Moal <damien.lemoal@wdc.com>
Subject: [PATCH] btrfs-progs:  default to SINGLE profile on zoned devices
Date: Tue,  6 Jul 2021 18:19:22 +0900	[thread overview]
Message-ID: <20210706091922.38650-1-johannes.thumshirn@wdc.com> (raw)

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


             reply	other threads:[~2021-07-06  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  9:19 Johannes Thumshirn [this message]
2021-07-06 13:41 ` [PATCH] btrfs-progs: default to SINGLE profile on zoned devices 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210706091922.38650-1-johannes.thumshirn@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=damien.lemoal@wdc.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.