]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs/157,xfs/547,xfs/548: switch to using _scratch_mkfs_sized
authorHans Holmberg <Hans.Holmberg@wdc.com>
Tue, 8 Oct 2024 10:52:04 +0000 (10:52 +0000)
committerZorro Lang <zlang@kernel.org>
Thu, 10 Oct 2024 08:03:40 +0000 (16:03 +0800)
These test cases specify small -d sizes which combined with a rt dev of
unrestricted size and the rtrmap feature can cause mkfs to fail with
error:

mkfs.xfs: cannot handle expansion of realtime rmap btree; need <x> free
blocks, have <y>

This is due to that the -d size is not big enough to support the
metadata space allocation required for the rt groups.

Switch to use _scratch_mkfs_sized that sets up the -r size parameter
to avoid this. If -r size=x and -d size=x we will not risk running
out of space on the ddev as the metadata size is just a fraction of
the rt data size.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/157
tests/xfs/547
tests/xfs/548

index 79d45ac2bb34625c1a83e6c1fb0dbf99163c429d..9b5badbaeb3c765fc7659b9659eaa4d6cdcd5d1f 100755 (executable)
@@ -34,18 +34,21 @@ _require_test
 _require_scratch_nocheck
 _require_command "$XFS_ADMIN_PROG" "xfs_admin"
 
+
 # Create some fake sparse files for testing external devices and whatnot
+fs_size=$((500 * 1024 * 1024))
+
 fake_datafile=$TEST_DIR/$seq.scratch.data
 rm -f $fake_datafile
-truncate -s 500m $fake_datafile
+truncate -s $fs_size $fake_datafile
 
 fake_logfile=$TEST_DIR/$seq.scratch.log
 rm -f $fake_logfile
-truncate -s 500m $fake_logfile
+truncate -s $fs_size $fake_logfile
 
 fake_rtfile=$TEST_DIR/$seq.scratch.rt
 rm -f $fake_rtfile
-truncate -s 500m $fake_rtfile
+truncate -s $fs_size $fake_rtfile
 
 # Save the original variables
 orig_ddev=$SCRATCH_DEV
@@ -63,7 +66,8 @@ scenario() {
 }
 
 check_label() {
-       _scratch_mkfs -L oldlabel >> $seqres.full
+       MKFS_OPTIONS="-L oldlabel $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
+               >> $seqres.full
        _scratch_xfs_db -c label
        _scratch_xfs_admin -L newlabel "$@" >> $seqres.full
        _scratch_xfs_db -c label
index eada4aadc27fe738bb9f47919b1251fc7a61fbf7..ffac546be4cdab083ef90ec69e57cd0fa16e399d 100755 (executable)
@@ -24,10 +24,12 @@ _require_xfs_db_command path
 _require_test_program "punch-alternating"
 _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
 
+fs_size=$((512 * 1024 * 1024))
+
 for nrext64 in 0 1; do
        echo "* Verify extent counter fields with nrext64=${nrext64} option"
 
-       _scratch_mkfs -i nrext64=${nrext64} -d size=$((512 * 1024 * 1024)) \
+       MKFS_OPTIONS="-i nrext64=${nrext64} $MKFS_OPTIONS" _scratch_mkfs_sized $fs_size \
                      >> $seqres.full
        _scratch_mount >> $seqres.full
 
index f0b58563e64dc0918d4cfdee4b44f3347b47ff80..af72885a9c6eb2ebca31e3fadc038889140b37f4 100755 (executable)
@@ -24,7 +24,7 @@ _require_xfs_db_command path
 _require_test_program "punch-alternating"
 _require_xfs_io_error_injection "bmap_alloc_minlen_extent"
 
-_scratch_mkfs -d size=$((512 * 1024 * 1024)) >> $seqres.full
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
 bsize=$(_get_file_block_size $SCRATCH_MNT)