diff mbox series

[1/2] common/xfs: _notrun tests that fail due to block size < sector size

Message ID 172912045609.2583984.9245803618825626168.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [1/2] common/xfs: _notrun tests that fail due to block size < sector size | expand

Commit Message

Darrick J. Wong Oct. 16, 2024, 11:15 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

It makes no sense to fail a test that failed to format a filesystem with
a block size smaller than the sector size since the test preconditions
are not valid.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/xfs |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/common/xfs b/common/xfs
index 62e3100ee117a7..53d55f9907fbb0 100644
--- a/common/xfs
+++ b/common/xfs
@@ -172,6 +172,11 @@  _try_scratch_mkfs_xfs()
 		mkfs_status=$?
 	fi
 
+	if [ $mkfs_status -ne 0 ] && grep -q '^block size [0-9]* cannot be smaller than sector size' "$tmp.mkfserr"; then
+		errormsg="$(grep '^block size [0-9]* cannot be smaller than sector size' "$tmp.mkfserr" | head -n 1)"
+		_notrun "_scratch_mkfs_xfs: $errormsg"
+	fi
+
 	# output mkfs stdout and stderr
 	cat $tmp.mkfsstd
 	cat $tmp.mkfserr >&2