]> 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>
Sun, 24 Nov 2024 13:56:44 +0000 (14:56 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 30 Jan 2025 05:40:19 +0000 (06:40 +0100)
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 file systems 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

index 86953b7310d97847b92b35b5d2692f64f45d5e5f..a18b721eb5cfffb6865dbcfd7c03af027d207865 100644 (file)
@@ -2054,6 +2054,12 @@ _scratch_xfs_find_metafile()
 # Force metadata directories off.
 _scratch_xfs_force_no_metadir()
 {
+       _require_non_zoned_device $SCRATCH_DEV
+       # 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
+
        # Remove any mkfs-time quota options because those are only supported
        # with metadir=1
        for opt in uquota gquota pquota; do
@@ -2074,6 +2080,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
 }
 
 # do not run on zoned file systems