Skip to contentSkip to conversation

xfs/032: test the next block size if mkfs fails

PATCH In review Zorro Lang 2 participants 2 messages Sep 30, 2016

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH v2 1/1 xfs/032: test the next block size if mkfs fails

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.

---

V1 try to find the minimum acceptable block size at first, V2 drop that method, and then *continue* the test if _scratch_mkfs return error.

Thanks,
Zorro

 tests/xfs/032 | 5 +++++
 1 file changed, 5 insertions(+)
tests/xfs/032 +5 -0
index 6216379..4b675ee 100755
@@ -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
Signature · 1 line
2.7.4