From 0b66f6efd669c39cf37b5069280e8d1e94ff627d Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 26 Nov 2024 10:42:40 -0800 Subject: [PATCH] xfs/032: try running on blocksize > pagesize filesystems Now that we're no longer limited to blocksize <= pagesize, let's make sure that mkfs, fsstress, and copy work on such things. This is also a subtle way to get more people running at least one test with that config. Signed-off-by: "Darrick J. Wong" Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- tests/xfs/032 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/xfs/032 b/tests/xfs/032 index 1ecc02fe0..41a9134d8 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -36,19 +36,24 @@ do_copy() _fail "xfs_copy $opts corrupted for Sector size $SECTORSIZE Block size $BLOCKSIZE" } -while [ $SECTORSIZE -le $PAGESIZE ]; do - BLOCKSIZE=$SECTORSIZE; - - while [ $BLOCKSIZE -le $PAGESIZE ]; do - +for ((; SECTORSIZE <= 65536; SECTORSIZE *= 2)); do + for ((BLOCKSIZE = SECTORSIZE; BLOCKSIZE <= 65536; BLOCKSIZE *= 2)); do echo "=== Sector size $SECTORSIZE Block size $BLOCKSIZE ==" >> $seqres.full _scratch_mkfs -s size=$SECTORSIZE -b size=$BLOCKSIZE -d size=1g >> $seqres.full 2>&1 # Maybe return error at here, e.g: mkfs.xfs -m crc=1 -b size=512 if [ $? -ne 0 ]; then - BLOCKSIZE=$(($BLOCKSIZE * 2)) continue fi - _scratch_mount + if ! _try_scratch_mount; then + if [ $BLOCKSIZE -le $PAGESIZE ]; then + _fail "mount $(_scratch_mount_options $*) failed" + fi + + # Not all kernels support blocksize > pagesize + # filesystems, so we move on to the next sector size if + # mount fails. + break + fi # light population of the fs _run_fsstress -n 100 -d $SCRATCH_MNT _scratch_unmount @@ -58,10 +63,7 @@ while [ $SECTORSIZE -le $PAGESIZE ]; do do_copy -d fi do_copy - - BLOCKSIZE=$(($BLOCKSIZE * 2)); done - SECTORSIZE=$(($SECTORSIZE * 2)); done # success, all done -- 2.50.1