]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: handle zoned file systems in _scratch_xfs_force_no_metadir
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Oct 2024 11:26:25 +0000 (13:26 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 24 Oct 2024 14:00:04 +0000 (16:00 +0200)
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 <hch@lst.de>
common/xfs
tests/xfs/033
tests/xfs/178

index 7faa880169f9608a014e67af99d34650848eb041..67951d21095b071bb9d2817807b5a498f05211ee 100644 (file)
@@ -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.
index 848984d42d8b75c4f8afa99177afe8f3b70d305e..0891be0b583e6488bae60bf96f9b2f4b0664a380 100755 (executable)
@@ -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
index f0438f1ec4615b8827f57340690abf2ccdde929d..9e21577e0ea81d5970a4f33b4f29f33aac1323bb 100755 (executable)
@@ -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