From 36b18323b81d490ddefbe860cecff3defa95b68c Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 24 Oct 2024 13:26:25 +0200 Subject: [PATCH] xfs: handle zoned file systems in _scratch_xfs_force_no_metadir zoned file systems required the metadir feature. If the tests are run on a conventional block device as the RT device, we can simply remove the zoned flag an run the test, but if the RT device sits on a zoned block device there is no way to run a test that wants a non-metadir file system. Signed-off-by: Christoph Hellwig --- common/xfs | 10 ++++++++++ tests/xfs/033 | 3 --- tests/xfs/178 | 3 --- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/common/xfs b/common/xfs index 7faa88016..67951d210 100644 --- a/common/xfs +++ b/common/xfs @@ -2041,6 +2041,11 @@ _scratch_xfs_find_metafile() # Force metadata directories off. _scratch_xfs_force_no_metadir() { + # metadir is required for when the rt device is on a zoned device + if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then + _require_non_zoned_device $SCRATCH_RTDEV + fi + if echo "$MKFS_OPTIONS" | grep -q 'metadir='; then MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/metadir=[0-9]*/metadir=0/g' -e 's/metadir\([, ]\)/metadir=0\1/g')" return @@ -2049,6 +2054,11 @@ _scratch_xfs_force_no_metadir() if grep -q 'metadir=' $MKFS_XFS_PROG; then MKFS_OPTIONS="-m metadir=0 $MKFS_OPTIONS" fi + + # zoned requires metadir + if grep -q 'zoned=' $MKFS_XFS_PROG; then + MKFS_OPTIONS="-m zoned=0 $MKFS_OPTIONS" + fi } # Decide if a mount filesystem has metadata directory trees. diff --git a/tests/xfs/033 b/tests/xfs/033 index 848984d42..0891be0b5 100755 --- a/tests/xfs/033 +++ b/tests/xfs/033 @@ -48,9 +48,6 @@ _filter_bad_ids() grep -E -v 'bad user id 0xffffffff|bad group id 0xffffffff' } -# RT requires metadir (this needs a better check..) -_require_non_zoned_device $SCRATCH_RTDEV - _require_scratch _require_no_large_scratch_dev _scratch_xfs_force_no_metadir diff --git a/tests/xfs/178 b/tests/xfs/178 index f0438f1ec..9e21577e0 100755 --- a/tests/xfs/178 +++ b/tests/xfs/178 @@ -51,9 +51,6 @@ _dd_repair_check() _require_scratch _scratch_xfs_force_no_metadir -# zoned requires metadir. -# XXX: this should probably go into _scratch_xfs_force_no_metadir -_require_non_zoned_device $SCRATCH_RTDEV _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs -- 2.50.1