From 8d3c7a7a88a493026cf873b0fb39efa546033ab8 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 24 Oct 2024 13:50:09 +0200 Subject: [PATCH] xfs: add a _require_scratch_non_zoned helper Certain tests can't run on zoned file systems. Add a helper to _notrun them in this case. Signed-off-by: Christoph Hellwig --- common/xfs | 12 ++++++++++++ tests/xfs/1856 | 3 +-- tests/xfs/419 | 5 ++--- tests/xfs/540 | 5 ++--- tests/xfs/596 | 3 ++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/common/xfs b/common/xfs index 67951d210..c0d46a228 100644 --- a/common/xfs +++ b/common/xfs @@ -2061,6 +2061,18 @@ _scratch_xfs_force_no_metadir() fi } +# do not run on zoned file systems +_require_scratch_non_zoned() +{ + if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then + _require_non_zoned_device $SCRATCH_RTDEV + + if echo "$MKFS_OPTIONS" | grep -q 'zoned=1'; then + _notrun "Not supported on zoned file systems" + fi + fi +} + # Decide if a mount filesystem has metadata directory trees. _xfs_mount_has_metadir() { local mount="$1" diff --git a/tests/xfs/1856 b/tests/xfs/1856 index 9ef099ee4..ad37f944f 100755 --- a/tests/xfs/1856 +++ b/tests/xfs/1856 @@ -15,9 +15,8 @@ _begin_fstest auto mkfs repair _require_check_dmesg _require_scratch_nocheck _require_scratch_xfs_crc - # zoned requires metadir and doesn't support old features -_require_non_zoned_device $SCRATCH_RTDEV +_require_scratch_non_zoned # Does repair know how to add a particular feature to a filesystem? check_repair_upgrade() diff --git a/tests/xfs/419 b/tests/xfs/419 index 614a145e9..29e5ac083 100755 --- a/tests/xfs/419 +++ b/tests/xfs/419 @@ -27,9 +27,8 @@ _begin_fstest auto quick realtime mkfs _require_realtime _require_scratch - -# no extsize support on zoned file systems -_require_non_zoned_device $SCRATCH_RTDEV +# no support for rtextsize > 1 on zoned file systems +_require_scratch_non_zoned # Check mkfs.xfs option parsing with regards to rtinherit. XFS doesn't require # the realtime volume to be present to set rtinherit, so it's safe to call the diff --git a/tests/xfs/540 b/tests/xfs/540 index aadcd4704..7a79aacc3 100755 --- a/tests/xfs/540 +++ b/tests/xfs/540 @@ -24,9 +24,8 @@ _begin_fstest auto repair fuzzers . ./common/filter _require_scratch - -# zoned RT devices don't support rtextsize -_require_non_zoned_device $SCRATCH_RTDEV +# no support for rtextsize > 1 on zoned file systems +_require_scratch_non_zoned echo "Format and mount" _scratch_mkfs -r extsize=7b | _filter_mkfs > $seqres.full 2>$tmp.mkfs diff --git a/tests/xfs/596 b/tests/xfs/596 index 315d2ebfb..ffa4f9501 100755 --- a/tests/xfs/596 +++ b/tests/xfs/596 @@ -26,7 +26,8 @@ _cleanup() _require_scratch _require_realtime _require_no_large_scratch_dev -_require_non_zoned_device $SCRATCH_RTDEV # no growfs support for zoned rt devices +# growfs on zoned file systems only works on zone boundaries +_require_scratch_non_zoned _scratch_unmount 2>/dev/null _fill() -- 2.50.1