]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs/032: test the next block size if mkfs fails
authorZorro Lang <zlang@redhat.com>
Fri, 30 Sep 2016 06:58:46 +0000 (14:58 +0800)
committerEryu Guan <eguan@redhat.com>
Fri, 7 Oct 2016 09:18:53 +0000 (17:18 +0800)
If test on a 512b sector size device, xfs/032 will try to do:

  mkfs.xfs -s size=512 -b size=512 ...

The 512b block size is not acceptable for V5 XFS. So if mkfs.xfs
fails, try next block size (blksize *= 2) directly.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/xfs/032

index 62163790d53ad71b64d9b0d42ce5a2a562bc402e..4b675ee30c3612497d3cb99db379f9670e0bfc36 100755 (executable)
@@ -60,6 +60,11 @@ while [ $SECTORSIZE -le $PAGESIZE ]; 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
                # light population of the fs
                $FSSTRESS_PROG -n 100 -d $SCRATCH_MNT >> $seqres.full 2>&1