]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
common: support internal RT devices in scratch_mkfs_sized
authorChristoph Hellwig <hch@lst.de>
Sat, 23 Nov 2024 07:26:24 +0000 (08:26 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 30 Jan 2025 05:01:11 +0000 (06:01 +0100)
Signed-off-by: Christoph Hellwig <hch@lst.de>
common/rc

index 69ba7bc33bd47201b75a8fe5bf2e2312c8944fe0..daf3c787fb851e2fcd0465814574af9237af2fa8 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1260,6 +1260,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`
@@ -1267,6 +1268,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.