All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: [PATCH v3 1/6] common/rc: fix btrfs mixed mode usage in _scratch_mkfs_sized
Date: Fri, 18 Feb 2022 16:31:51 +0900	[thread overview]
Message-ID: <20220218073156.2179803-2-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20220218073156.2179803-1-shinichiro.kawasaki@wdc.com>

The helper function _scratch_mkfs_sized needs a couple of improvements
for btrfs. At first, the function adds --mixed option to mkfs.btrfs when
the filesystem size is smaller then 256MiB, but this threshold is no
longer correct and it should be 109MiB. Secondly, the --mixed option
shall not be specified to mkfs.btrfs for zoned devices, since zoned
devices does not allow mixing metadata blocks and data blocks.

Suggested-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 common/rc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/rc b/common/rc
index de60fb7b..74d2d8bd 100644
--- a/common/rc
+++ b/common/rc
@@ -1075,10 +1075,10 @@ _scratch_mkfs_sized()
 		;;
 	btrfs)
 		local mixed_opt=
-		# minimum size that's needed without the mixed option.
-		# Ref: btrfs-prog: btrfs_min_dev_size()
-		# Non mixed mode is also the default option.
-		(( fssize < $((256 * 1024 *1024)) )) && mixed_opt='--mixed'
+		# Mixed option is required when the filesystem size is small and
+		# the device is not zoned. Ref: btrfs-progs: btrfs_min_dev_size()
+		(( fssize < $((109 * 1024 * 1024)) )) &&
+			! _scratch_btrfs_is_zoned && mixed_opt='--mixed'
 		$MKFS_BTRFS_PROG $MKFS_OPTIONS $mixed_opt -b $fssize $SCRATCH_DEV
 		;;
 	jfs)
-- 
2.34.1


  reply	other threads:[~2022-02-18  7:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  7:31 [PATCH v3 0/6] fstests: fix _scratch_mkfs_sized failure handling Shin'ichiro Kawasaki
2022-02-18  7:31 ` Shin'ichiro Kawasaki [this message]
2022-02-20 17:00   ` [PATCH v3 1/6] common/rc: fix btrfs mixed mode usage in _scratch_mkfs_sized Eryu Guan
2022-02-21  7:02     ` Naohiro Aota
2022-02-21 11:02       ` Shinichiro Kawasaki
2022-02-18  7:31 ` [PATCH v3 2/6] generic/204: remove unnecessary _scratch_mkfs call Shin'ichiro Kawasaki
2022-02-18  7:31 ` [PATCH v3 3/6] generic/{171,172,173,174}: check _scratch_mkfs_sized return code Shin'ichiro Kawasaki
2022-02-18  7:31 ` [PATCH v3 4/6] ext4/021: " Shin'ichiro Kawasaki
2022-02-18  7:31 ` [PATCH v3 5/6] xfs/015: " Shin'ichiro Kawasaki
2022-02-18  7:31 ` [PATCH v3 6/6] common: factor out xfs unique part from _filter_mkfs Shin'ichiro Kawasaki
2022-02-20 17:03 ` [PATCH v3 0/6] fstests: fix _scratch_mkfs_sized failure handling Eryu Guan

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=20220218073156.2179803-2-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=fstests@vger.kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    /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.