]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs/032: try running on blocksize > pagesize filesystems
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Nov 2024 18:42:40 +0000 (10:42 -0800)
committerZorro Lang <zlang@kernel.org>
Fri, 10 Jan 2025 04:44:03 +0000 (12:44 +0800)
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" <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/032

index 1ecc02fe05f965e3864e92438f825bd1144eed23..41a9134d8955075128fec5723c096e9031eabb0f 100755 (executable)
@@ -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