aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-04-18 09:40:46 +0200
committerZorro Lang <zlang@kernel.org>2024-04-20 22:40:48 +0800
commitb9785de77fcb7b4c9f58d6d7178a0ef63a059b84 (patch)
tree27eb615a7da64a41d261ce088f5af0ccc7ec5818
parentde346dc82313ebd39022603c71e5cc9a76133309 (diff)
downloadxfstests-dev-b9785de77fcb7b4c9f58d6d7178a0ef63a059b84.tar.gz
xfs: don't run tests that require v4 file systems when not supported
Add a _require_xfs_nocrc helper that checks that we can mkfs and mount a crc=0 file systems before running tests that rely on it to avoid failures on kernels with CONFIG_XFS_SUPPORT_V4 disabled. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r--common/xfs10
-rwxr-xr-xtests/xfs/0021
-rwxr-xr-xtests/xfs/0951
-rwxr-xr-xtests/xfs/0961
-rwxr-xr-xtests/xfs/1321
-rwxr-xr-xtests/xfs/1486
-rwxr-xr-xtests/xfs/19410
-rwxr-xr-xtests/xfs/1991
-rwxr-xr-xtests/xfs/3001
-rwxr-xr-xtests/xfs/5263
-rwxr-xr-xtests/xfs/6121
-rwxr-xr-xtests/xfs/6131
12 files changed, 37 insertions, 0 deletions
diff --git a/common/xfs b/common/xfs
index 49ca5a2d52..733c3a5be4 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1852,3 +1852,13 @@ _xfs_discard_max_offset_kb()
$XFS_IO_PROG -c 'statfs' "$1" | \
awk '{g[$1] = $3} END {print (g["geom.bsize"] * g["geom.datablocks"] / 1024)}'
}
+
+# check if mkfs and the kernel support nocrc (v4) file systems
+_require_xfs_nocrc()
+{
+ _scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \
+ _notrun "v4 file systems not supported"
+ _try_scratch_mount > /dev/null 2>&1 || \
+ _notrun "v4 file systems not supported"
+ _scratch_unmount
+}
diff --git a/tests/xfs/002 b/tests/xfs/002
index 8dfd2693b1..26d0cd6e48 100755
--- a/tests/xfs/002
+++ b/tests/xfs/002
@@ -23,6 +23,7 @@ _begin_fstest auto quick growfs
_supported_fs xfs
_require_scratch_nocheck
_require_no_large_scratch_dev
+_require_xfs_nocrc
_scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed"
diff --git a/tests/xfs/095 b/tests/xfs/095
index a3891c85e4..e7dc3e9f40 100755
--- a/tests/xfs/095
+++ b/tests/xfs/095
@@ -19,6 +19,7 @@ _begin_fstest log v2log auto
_supported_fs xfs
_require_scratch
_require_v2log
+_require_xfs_nocrc
if [ "$(blockdev --getss $SCRATCH_DEV)" != "512" ]; then
_notrun "need 512b sector size"
diff --git a/tests/xfs/096 b/tests/xfs/096
index 7eff6cb1d7..0a1bfb3fa8 100755
--- a/tests/xfs/096
+++ b/tests/xfs/096
@@ -20,6 +20,7 @@ _supported_fs xfs
_require_scratch
_require_xfs_quota
+_require_xfs_nocrc
function option_string()
{
diff --git a/tests/xfs/132 b/tests/xfs/132
index ee1c8c1ec0..b46d3d28c8 100755
--- a/tests/xfs/132
+++ b/tests/xfs/132
@@ -19,6 +19,7 @@ _supported_fs xfs
# we intentionally corrupt the filesystem, so don't check it after the test
_require_scratch_nocheck
+_require_xfs_nocrc
# on success, we'll get a shutdown filesystem with a really noisy log message
# due to transaction cancellation. Hence we don't want to check dmesg here.
diff --git a/tests/xfs/148 b/tests/xfs/148
index c9f634cfd0..fde3bf476e 100755
--- a/tests/xfs/148
+++ b/tests/xfs/148
@@ -27,6 +27,8 @@ _cleanup()
_supported_fs xfs
_require_test
_require_attrs
+_require_xfs_nocrc
+
_disable_dmesg_check
imgfile=$TEST_DIR/img-$seq
@@ -40,6 +42,10 @@ test_names=("something" "$nullstr" "$slashstr" "another")
rm -f $imgfile $imgfile.old
# Format image file w/o crcs so we can sed the image file
+#
+# TODO: It might be possible to rewrite this using proper xfs_db
+# fs manipulation commands that would work with CRCs.
+#
# We need to use 512 byte inodes to ensure the attr forks remain in short form
# even when security xattrs are present so we are always doing name matches on
# lookup and not name hash compares as leaf/node forms will do.
diff --git a/tests/xfs/194 b/tests/xfs/194
index 5a1dff5d24..2fcc55b3e2 100755
--- a/tests/xfs/194
+++ b/tests/xfs/194
@@ -30,6 +30,16 @@ _supported_fs xfs
# real QA test starts here
_require_scratch
+
+#
+# This currently forces nocrc because only that can support 512 byte block size
+# and thus block size = 1/8 page size on 4k page size systems.
+# In theory we could run it on systems with larger page size with CRCs, or hope
+# that large folios would trigger the same issue.
+# But for now that is left as an exercise for the reader.
+#
+_require_xfs_nocrc
+
_scratch_mkfs_xfs >/dev/null 2>&1
# For this test we use block size = 1/8 page size
diff --git a/tests/xfs/199 b/tests/xfs/199
index 4669f2c3e6..f99b04db3d 100755
--- a/tests/xfs/199
+++ b/tests/xfs/199
@@ -26,6 +26,7 @@ _cleanup()
_supported_fs xfs
_require_scratch
+_require_xfs_nocrc
# clear any mkfs options so that we can directly specify the options we need to
# be able to test the features bitmask behaviour correctly.
diff --git a/tests/xfs/300 b/tests/xfs/300
index 2ee5eee715..bc1f0efc6a 100755
--- a/tests/xfs/300
+++ b/tests/xfs/300
@@ -13,6 +13,7 @@ _begin_fstest auto fsr
. ./common/filter
_require_scratch
+_require_xfs_nocrc
# real QA test starts here
diff --git a/tests/xfs/526 b/tests/xfs/526
index 4261e84973..c5c5f9b1ac 100755
--- a/tests/xfs/526
+++ b/tests/xfs/526
@@ -27,6 +27,9 @@ _require_test
_require_scratch_nocheck
_require_xfs_mkfs_cfgfile
+# Currently the only conflicting options are v4 specific
+_require_xfs_nocrc
+
cfgfile=$TEST_DIR/a
rm -rf $cfgfile
diff --git a/tests/xfs/612 b/tests/xfs/612
index 4ae4d39778..0f6df7deb0 100755
--- a/tests/xfs/612
+++ b/tests/xfs/612
@@ -17,6 +17,7 @@ _supported_fs xfs
_require_scratch_xfs_inobtcount
_require_command "$XFS_ADMIN_PROG" "xfs_admin"
_require_xfs_repair_upgrade inobtcount
+_require_xfs_nocrc
# Make sure we can't upgrade to inobt on a V4 filesystem
_scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full
diff --git a/tests/xfs/613 b/tests/xfs/613
index 522358cb3b..8bff21711c 100755
--- a/tests/xfs/613
+++ b/tests/xfs/613
@@ -34,6 +34,7 @@ _supported_fs xfs
_fixed_by_kernel_commit 237d7887ae72 \
"xfs: show the proper user quota options"
+_require_xfs_nocrc
_require_test
_require_loop
_require_xfs_io_command "falloc"