Thread (16 messages) 16 messages, 3 authors, 2025-02-21
STALE502d
Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current

[PATCH blktests v3 4/6] common/xfs: use min io for fs blocksize

From: Luis Chamberlain <mcgrof@kernel.org>
Date: 2025-02-12 20:54:51
Also in: linux-patches
Subsystem: the rest · Maintainer: Linus Torvalds

Use the min io for the target block size. Likewise we need to increase
the log size if using a bs > 4096.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 common/xfs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/common/xfs b/common/xfs
index 67a3b8a97391..226fdbd1c83f 100644
--- a/common/xfs
+++ b/common/xfs
@@ -13,10 +13,18 @@ _have_xfs() {
 _xfs_mkfs_and_mount() {
 	local bdev=$1
 	local mount_dir=$2
+	local bs
+	local xfs_logsize="64m"
+
+	bs=$(_min_io "$bdev")
+
+	if [[ $bs -gt 4096 ]]; then
+		xfs_logsize="128m"
+	fi
 
 	mkdir -p "${mount_dir}"
 	umount "${mount_dir}" >/dev/null 2>&1
-	mkfs.xfs -l size=64m -f "${bdev}" || return $?
+	mkfs.xfs -l size=$xfs_logsize -f "${bdev}" -b size="$bs" || return $?
 	mount "${bdev}" "${mount_dir}"
 }
 
-- 
2.45.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help