]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: support internal RT devices in scratch_mkfs_sized
authorChristoph Hellwig <hch@lst.de>
Thu, 1 May 2025 13:38:58 +0000 (08:38 -0500)
committerZorro Lang <zlang@kernel.org>
Wed, 7 May 2025 14:12:02 +0000 (22:12 +0800)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc

index 7395ff610bd288c334c604327b6d79d6d39e1035..657772e73db86bffdb87e26284309847acd7730e 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1267,6 +1267,7 @@ _try_scratch_mkfs_sized()
        case $FSTYP in
        xfs)
                local rt_ops
+               local zone_type=`_zone_type $SCRATCH_DEV`
 
                if [ -b "$SCRATCH_RTDEV" ]; then
                        local rtdevsize=`blockdev --getsize64 $SCRATCH_RTDEV`
@@ -1274,6 +1275,12 @@ _try_scratch_mkfs_sized()
                                _notrun "Scratch rt device too small"
                        fi
                        rt_ops="-r size=$fssize"
+               elif [ "${zone_type}" != "none" ] ||
+                    [[ $MKFS_OPTIONS =~ "zoned=1" ]]; then
+                       # Maybe also add back the size check, but it'll require
+                       # somewhat complicated arithmetics for the size of the
+                       # conventional zones
+                       rt_ops="-r size=$fssize"
                fi
 
                # don't override MKFS_OPTIONS that set a block size.