From patchwork Wed Feb 9 12:33:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 12740219 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69B63C433F5 for ; Wed, 9 Feb 2022 12:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233304AbiBIMeM (ORCPT ); Wed, 9 Feb 2022 07:34:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233162AbiBIMeH (ORCPT ); Wed, 9 Feb 2022 07:34:07 -0500 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28761C05CB96; Wed, 9 Feb 2022 04:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1644410050; x=1675946050; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TUe9FJuEf7BWKrxSIxqPYK0eG0nCVdO3BScCuHtRrAI=; b=mkGoSj8+sfXYSdt6PZStHKyA1AwzszXeK+PGJB6zS4GHaV8fotLq5RqM wkIQmbbAi27ulLVzT8BvlgRXx48sphGz4sC6GCI3evq6o6H/YuxBFQpbX +sbYT13qHfqJa+tildjsCyjmzH74rP454pQqpqvYQq9oY/PVKbyYDF8OZ ztweHqv1Oc4Ods8jrieZF02jQFIdEWDpQiFb9ZxvQrX7pvlPcYf68JCZ6 f+YID5Xjsv5JmW+i0Tqgh6Q9fD+o1YY23TMxMsO/js3zhObnoKOrxNIqj /jot5ivPQ9FPCIUaLgTIlQTYcx6E7XaeZspf+vRWC/yRinXMkymvvfkfb Q==; X-IronPort-AV: E=Sophos;i="5.88,355,1635177600"; d="scan'208";a="197322995" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 09 Feb 2022 20:33:06 +0800 IronPort-SDR: UKvnn3t/y3EyLzUMId9SnrRlcDZ8vkfLzFAwIvs2wkTigLovNtQZQzTfWmQ1EJkS9xmqahydkK vAz1XVO/UZs/04nCjle7dGZWB1p3rzpgKHZAA8unq+gWLkNWBZJre+hK5aqYI+j4wghRJGSyPi ocTG1vQqyiNX7rGt3id+2r1q9rqWJu1xq2GI/GnM5XIVt60xKmMWAKwIahrbRXRaZIT3BVKPiL hkv+gAAylKO7H6sfoXm1kl/3w2DnTT57y5CJA4P2fD0Ynq07jXTJ3eyppwGA4CzoC+5TUchKWD l4QKVEAUpEz+KZR5NmVoCF9J Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 04:04:56 -0800 IronPort-SDR: vAiN5QyjjjKejAtdG4aNSJlQ6OOVQ7nxR2T5oGBTNi3VGK0TIN+Egcj7/3qS3mJpa/jbuxURfF vb2aVZTxwMlitQ+vFQUeixI2NGrwuP0JPru+f3vB8+626QCflo3YVd/so7/cvKLaT/KGNNGbB0 Vt1OU/EbWoaEA+s04mu2ugRJPPdz2XW7+/fU8KGIqzjn3WJi4tidut9M3c7nPd9dsfIMGCzBpc xRuzR/BM2IIju0FH3crAD3ev0g3hLvNJQZzholK7eJ8psnP/4zCy+B+JxPurRV9RmZL867zRWO 9f8= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.52.173]) by uls-op-cesaip02.wdc.com with ESMTP; 09 Feb 2022 04:33:07 -0800 From: Shin'ichiro Kawasaki To: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org Cc: linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, Naohiro Aota , Johannes Thumshirn , Damien Le Moal , Shin'ichiro Kawasaki Subject: [PATCH v2 1/6] common/rc: fix btrfs mixed mode usage in _scratch_mkfs_sized Date: Wed, 9 Feb 2022 21:33:00 +0900 Message-Id: <20220209123305.253038-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209123305.253038-1-shinichiro.kawasaki@wdc.com> References: <20220209123305.253038-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 Signed-off-by: Shin'ichiro Kawasaki Reviewed-by: Johannes Thumshirn --- common/rc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/rc b/common/rc index b3289de9..eb2493d1 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)