]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
ext4/028: require that the scratch file system has the extent feature enabled
authorTheodore Ts'o <tytso@mit.edu>
Sun, 20 Jul 2025 03:59:44 +0000 (23:59 -0400)
committerZorro Lang <zlang@kernel.org>
Thu, 31 Jul 2025 08:55:20 +0000 (16:55 +0800)
If the file system configuration has journalling enabled, but doesn't
have the extent feature enabled (e.g., when testing the ext3
configuration) the test will fail since _scratch_populate_cached
creates files with extents enabled.  So add a check to skip the test
in that case.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/ext4
tests/ext4/028

index f88fa53244413d3308311a9090313d9101fc9b0d..a2ce456d4ec761cda813e760abbca14dbaafeeb3 100644 (file)
@@ -165,15 +165,26 @@ _ext4_mdrestore()
        return $res
 }
 
-# this test requires the ext4 kernel support crc feature on scratch device
+# this test requires the ext4 kernel supports a particular feature
+# on the scratch device
 #
+_require_scratch_ext4_feature_enabled()
+{
+    if [ -z "$1" ]; then
+        echo "Usage: _require_scratch_ext4_feature feature"
+        _exit 1
+    fi
+    _scratch_mkfs_ext4 >/dev/null 2>&1
+    $DUMPE2FS_PROG -h $SCRATCH_DEV 2> /dev/null | grep -q "$1" || \
+       _notrun "$1 not enabled by this filesystem"
+    _try_scratch_mount >/dev/null 2>&1 \
+       || _notrun "Kernel doesn't support $1 feature"
+    _scratch_unmount
+}
+
 _require_scratch_ext4_crc()
 {
-       _scratch_mkfs_ext4 >/dev/null 2>&1
-       dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
-       _try_scratch_mount >/dev/null 2>&1 \
-          || _notrun "Kernel doesn't support metadata_csum feature"
-       _scratch_unmount
+    _require_scratch_ext4_feature_enabled "metadata_csum"
 }
 
 # Check whether the specified feature whether it is supported by
index 1b8855098f82f4e5bb8a110bff2e6ed729c1eca2..254074f087b2d2f3ca7f07713bbd98788020e721 100755 (executable)
@@ -24,6 +24,7 @@ _exclude_fs ext2
 _exclude_fs ext3
 
 _require_scratch
+_require_scratch_ext4_feature_enabled "extent"
 _require_populate_commands
 _require_xfs_io_command "fsmap"