FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency
@ 2026-05-20 18:52 Darrick J. Wong
  2026-05-25  5:43 ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2026-05-20 18:52 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, xfs

From: Darrick J. Wong <djwong@kernel.org>

generic/347 regresses when external logs are in the configuration:

 --- a/generic/347.out		2025-07-15 14:45:15.044714644 -0700
 +++ b/generic/347.out.bad	2026-05-18 23:17:01.687750781 -0700
 @@ -1,2 +1,36 @@
  QA output created by 347
 -=== completed
 +Cannot specify both -l logdev and -l concurrency
 +Usage: mkfs.xfs

Since this actually tests running mkfs.xfs with $SCRATCH_OPTIONS, the
helper ought to have detected that you can't give both.  Unfortunately,
there's a weird switch that turns -l into -d even though they're not
quite the same option.  Delete that, and fix the indentation (tabs, not
spaces) in the helper.

Cc: <fstests@vger.kernel.org> # v2026.05.17
Fixes: 7f162f5bcf50fc ("common/xfs: helper function to check if -l/-d/-r concurrecy flags.")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 common/xfs |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/xfs b/common/xfs
index 4b3a7f7d153282..88299acdd086be 100644
--- a/common/xfs
+++ b/common/xfs
@@ -2431,8 +2431,7 @@ _require_xfs_healer()
 # -l/-d concurrency came in same xfsprogs release v6.7
  _scratch_mkfs_xfs_supports_concurrency()
 {
-    local arg="${1:-d}"
+	local arg="${1:-d}"
 
-    test "$arg" = "-l" && arg="-d"
-    _scratch_mkfs_xfs_supported "$arg" concurrency=0
+	_scratch_mkfs_xfs_supported "$arg" concurrency=0
 }

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

* Re: [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency
  2026-05-20 18:52 [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
@ 2026-05-25  5:43 ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-05-25  5:43 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Zorro Lang, fstests, xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

* [PATCHSET] fstests: more random fixes for v2026.06.21
@ 2026-06-25 16:50 Darrick J. Wong
  2026-06-25 16:51 ` [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
  2026-06-25 16:51 ` [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection Darrick J. Wong
  0 siblings, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2026-06-25 16:50 UTC (permalink / raw)
  To: zlang, djwong; +Cc: hch, fstests, hch, fstests, linux-xfs

Hi all,

Here's the usual odd fixes for fstests.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

With a bit of luck, this should all go splendidly.
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=random-fixes

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=random-fixes

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=random-fixes
---
Commits in this patchset:
 * common/xfs: fix _scratch_mkfs_xfs_supports_concurrency
 * xfs/21[67]: fix mkfs log concurrency detection
---
 common/xfs    |   11 ++++++++---
 tests/xfs/216 |    9 ++++-----
 tests/xfs/217 |    9 ++++-----
 3 files changed, 16 insertions(+), 13 deletions(-)


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

* [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency
  2026-06-25 16:50 [PATCHSET] fstests: more random fixes for v2026.06.21 Darrick J. Wong
@ 2026-06-25 16:51 ` Darrick J. Wong
  2026-06-26  4:52   ` Christoph Hellwig
  2026-06-25 16:51 ` [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection Darrick J. Wong
  1 sibling, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2026-06-25 16:51 UTC (permalink / raw)
  To: zlang, djwong; +Cc: fstests, hch, hch, fstests, linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

generic/347 regresses when external logs are in the configuration:

 --- a/generic/347.out		2025-07-15 14:45:15.044714644 -0700
 +++ b/generic/347.out.bad	2026-05-18 23:17:01.687750781 -0700
 @@ -1,2 +1,36 @@
  QA output created by 347
 -=== completed
 +Cannot specify both -l logdev and -l concurrency
 +Usage: mkfs.xfs

Since this actually tests running mkfs.xfs with $SCRATCH_OPTIONS, the
helper ought to have detected that you can't give both.  Unfortunately,
there's a weird switch that turns -l into -d even though they're not
quite the same option.  Delete that, and fix the indentation (tabs, not
spaces) in the helper.

Cc: <fstests@vger.kernel.org> # v2026.05.17
Fixes: 7f162f5bcf50fc ("common/xfs: helper function to check if -l/-d/-r concurrecy flags.")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 common/xfs |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


diff --git a/common/xfs b/common/xfs
index 4b3a7f7d153282..88299acdd086be 100644
--- a/common/xfs
+++ b/common/xfs
@@ -2431,8 +2431,7 @@ _require_xfs_healer()
 # -l/-d concurrency came in same xfsprogs release v6.7
  _scratch_mkfs_xfs_supports_concurrency()
 {
-    local arg="${1:-d}"
+	local arg="${1:-d}"
 
-    test "$arg" = "-l" && arg="-d"
-    _scratch_mkfs_xfs_supported "$arg" concurrency=0
+	_scratch_mkfs_xfs_supported "$arg" concurrency=0
 }


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

* [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection
  2026-06-25 16:50 [PATCHSET] fstests: more random fixes for v2026.06.21 Darrick J. Wong
  2026-06-25 16:51 ` [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
@ 2026-06-25 16:51 ` Darrick J. Wong
  2026-06-26  4:52   ` Christoph Hellwig
  1 sibling, 1 reply; 7+ messages in thread
From: Darrick J. Wong @ 2026-06-25 16:51 UTC (permalink / raw)
  To: zlang, djwong; +Cc: fstests, hch, fstests, linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

Both of these tests use _scratch_mkfs_xfs_supports_concurrency to detect
if they should be adding -lconcurrency=0 to the mkfs options that are
used to format a loop device.

However, this doesn't work in practice because of three factors: 1) the
scratch device could have an external log set up; 2) the loop device
does /not/ have an external log device; and 3) -lconcurrency isn't
compatible with -llogdev.

Fix this by creating a more general mkfs option detection helper and use
that once we have the loop device set up.

Cc: <fstests@vger.kernel.org> # v2026.05.17
Fixes: ffc8bad17e5b2f ("xfs/21{6,7} Use default -l concurrency=0 on mkfs.xfs that supports it")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 common/xfs    |    6 ++++++
 tests/xfs/216 |    9 ++++-----
 tests/xfs/217 |    9 ++++-----
 3 files changed, 14 insertions(+), 10 deletions(-)


diff --git a/common/xfs b/common/xfs
index 88299acdd086be..81add2086866c8 100644
--- a/common/xfs
+++ b/common/xfs
@@ -64,6 +64,12 @@ _scratch_mkfs_xfs_opts()
 	echo "$MKFS_XFS_PROG $SCRATCH_OPTIONS $mkfs_opts"
 }
 
+# Figure out if the supplied mkfs.xfs options are supported.  A device or file
+# path must be specified as one of the options, though it will not be written.
+_mkfs_xfs_supported()
+{
+	$MKFS_XFS_PROG -f -N "$@"
+}
 
 _scratch_mkfs_xfs_supported()
 {
diff --git a/tests/xfs/216 b/tests/xfs/216
index 1749647c11f716..48657242e65daf 100755
--- a/tests/xfs/216
+++ b/tests/xfs/216
@@ -22,11 +22,6 @@ _cleanup()
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
-if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
-	loop_mkfs_opts="-l concurrency=0"
-else
-	loop_mkfs_opts=""
-fi
 _scratch_mount
 
 _require_loop
@@ -76,6 +71,10 @@ mkdir $LOOP_MNT
 
 loop_dev=$(_create_loop_device $LOOP_IMG)
 
+if _mkfs_xfs_supported $loop_mkfs_opts -l concurrency=0 $loop_dev &>> $seqres.full; then
+	loop_mkfs_opts="$loop_mkfs_opts -l concurrency=0"
+fi
+
 # walk over standard sizes (up to 256GB)
 _do_mkfs 1 2 4 8 16 32 64 128 256
 
diff --git a/tests/xfs/217 b/tests/xfs/217
index 23aae842d1fb61..34ac8dae8ef43f 100755
--- a/tests/xfs/217
+++ b/tests/xfs/217
@@ -21,11 +21,6 @@ _cleanup()
 
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
-if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
-	loop_mkfs_opts="-l concurrency=0 -d concurrency=0"
-else
-	loop_mkfs_opts=""
-fi
 _scratch_mount
 # 16T mkfs requires a bit over 2G free
 _require_fs_space $SCRATCH_MNT 2202000
@@ -63,6 +58,10 @@ fi
 
 loop_dev=$(_create_loop_device $LOOP_IMG)
 
+if _mkfs_xfs_supported $loop_mkfs_opts -l concurrency=0 -d concurrency=0 $loop_dev &>> $seqres.full; then
+	loop_mkfs_opts="$loop_mkfs_opts -l concurrency=0 -d concurrency=0"
+fi
+
 #
 # walk over "new" sizes supported by recent xfsprogs.
 # Note that the last test is for 16TB-1GB as 32bit platforms only support


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

* Re: [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency
  2026-06-25 16:51 ` [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
@ 2026-06-26  4:52   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-06-26  4:52 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: zlang, fstests, hch, linux-xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection
  2026-06-25 16:51 ` [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection Darrick J. Wong
@ 2026-06-26  4:52   ` Christoph Hellwig
  0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2026-06-26  4:52 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: zlang, fstests, hch, linux-xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

end of thread, other threads:[~2026-06-26  4:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 16:50 [PATCHSET] fstests: more random fixes for v2026.06.21 Darrick J. Wong
2026-06-25 16:51 ` [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
2026-06-26  4:52   ` Christoph Hellwig
2026-06-25 16:51 ` [PATCH 2/2] xfs/21[67]: fix mkfs log concurrency detection Darrick J. Wong
2026-06-26  4:52   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2026-05-20 18:52 [PATCH 1/2] common/xfs: fix _scratch_mkfs_xfs_supports_concurrency Darrick J. Wong
2026-05-25  5:43 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox