Skip to contentSkip to conversation

xfs/032: avoid making a 512b block size V5 xfs

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

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 xfs/032: avoid making a 512b block size V5 xfs

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 I change the minimum block size to 1024 if (crc = 1 && sector size < 1024).

---
 tests/xfs/032 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
tests/xfs/032 +13 -1
index 6216379..487dbd9 100755
@@ -34,6 +34,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
+. ./common/filter
 
 # real QA test starts here
 _supported_fs xfs
@@ -50,11 +51,22 @@ rm -f $seqres.full
 SECTORSIZE=`blockdev --getss $SCRATCH_DEV`
 PAGESIZE=`src/feature -s`
 IMGFILE=$TEST_DIR/${seq}_copy.img
+MIN_BLKSIZE=$SECTORSIZE
+
+if [ $MIN_BLKSIZE -lt 1024 ]; then
+	_scratch_mkfs_sized $((512 * 1024 * 1024)) | _filter_mkfs \
+						2>$tmp.mkfs >/dev/null
+	. $tmp.mkfs
+	if [ $_fs_has_crcs -eq 1 ]; then
+		MIN_BLKSIZE=1024
+	fi
+	rm -f $tmp.mkfs
+fi
 
 echo "Silence is golden."
 
 while [ $SECTORSIZE -le $PAGESIZE ]; do
-	BLOCKSIZE=$SECTORSIZE;
+	BLOCKSIZE=$MIN_BLKSIZE;
 
 	while [ $BLOCKSIZE -le $PAGESIZE ]; do
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · Zorro Lang

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 I change the minimum block size to 1024 if (crc = 1 && sector size < 1024).

Why so complex?

The output of the test is empty, so if mkfs.xfs fails with the given configuration then just skip the loop iteration and run the next size.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]