From: Christoph Hellwig Date: Fri, 12 Jan 2024 05:08:31 +0000 (+0100) Subject: xfs: add a _require_scratch_xfs_scrub helper X-Git-Tag: v2024.01.14~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0864962b2d6553db6ce6942befd2764aa7d766a;p=xfstests-dev.git xfs: add a _require_scratch_xfs_scrub helper Add a helper to call _supports_xfs_scrub with $SCRATCH_MNT and $SCRATCH_DEV. [zlang: rename the _scratch_require_xxx to _require_scratch_xxx] Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/xfs b/common/xfs index 4e54d75c..f23e1e91 100644 --- a/common/xfs +++ b/common/xfs @@ -662,6 +662,13 @@ _supports_xfs_scrub() return 0 } +# Does the scratch file system support scrub? +_require_scratch_xfs_scrub() +{ + _supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || \ + _notrun "Scrub not supported" +} + # Save a snapshot of a corrupt xfs filesystem for later debugging. _xfs_metadump() { local metadump="$1" diff --git a/tests/xfs/556 b/tests/xfs/556 index 061d8d57..2f8cad1a 100755 --- a/tests/xfs/556 +++ b/tests/xfs/556 @@ -40,7 +40,7 @@ _scratch_mkfs >> $seqres.full _dmerror_init _dmerror_mount >> $seqres.full 2>&1 -_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported" +_require_scratch_xfs_scrub # Write a file with 4 file blocks worth of data victim=$SCRATCH_MNT/a diff --git a/tests/xfs/716 b/tests/xfs/716 index 930a0ecb..ef0af453 100755 --- a/tests/xfs/716 +++ b/tests/xfs/716 @@ -31,7 +31,7 @@ _require_test_program "punch-alternating" _scratch_mkfs > $tmp.mkfs _scratch_mount -_supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV || _notrun "Scrub not supported" +_require_scratch_xfs_scrub # Force data device extents so that we can create a file with the exact bmbt # that we need regardless of rt configuration.