xfstests: Obey mkfs options for sized filesystems on XFS
authorDave Chinner <dchinner@redhat.com>
Tue, 3 Sep 2013 00:14:54 +0000 (00:14 +0000)
committerRich Johnston <rjohnston@sgi.com>
Sun, 13 Oct 2013 23:30:53 +0000 (18:30 -0500)
The XFS implementation of _scratch_mkfs_sized ignores MKFS_OPTIONS
when a custom block size is set and so isn't testing things like
CRCs on such sized filesytsems. Fix this by ensuring we don't try to
override the block size is it is set in MKFS_OPTIONS. xfs/204 shows
this problem.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/rc
tests/generic/204

index 77e96c4c7a9421b92af827e2be7cae1e245e359a..4f7087358d3b821205a3cccdb2905d1b888119a7 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -578,7 +578,13 @@ _scratch_mkfs_sized()
 
     case $FSTYP in
     xfs)
-       _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
+       # don't override MKFS_OPTIONS that set a block size.
+       echo $MKFS_OPTIONS |egrep -q "b?size="
+       if [ $? -eq 0 ]; then
+               _scratch_mkfs_xfs -d size=$fssize
+       else
+               _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
+       fi
        ;;
     ext2|ext3|ext4|ext4dev)
        yes | ${MKFS_PROG}.$FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
index 98cb176de184d4535b6cd0e299e174bbb228ac62..a054c8f576141193e42087157c092403f5f72e16 100755 (executable)
@@ -39,13 +39,15 @@ _supported_os Linux
 
 _require_scratch
 
+rm -f $seqres.full
+
 SIZE=`expr 104 \* 1024 \* 1024`
 _scratch_mkfs_sized $SIZE  &> /dev/null
 _scratch_mount
 
 # fix the reserve block pool to a known size so that the enospc calculations
 # work out correctly.
-_scratch_resvblks 1024 > $seqres.full 2>&1
+_scratch_resvblks 1024 >> $seqres.full 2>&1
 
 for i in `seq 1 22500`; do
     echo -n > $SCRATCH_MNT/$i