]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/017: Do not create file systems with different block sizes
authorLukas Czerner <lczerner@redhat.com>
Tue, 14 Oct 2014 06:40:32 +0000 (17:40 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 14 Oct 2014 06:40:32 +0000 (17:40 +1100)
User takes care about specifying mkfs options he wishes to test and the
test itself should not change it if it's not strictly necessary for the
test itself.

In this case it is not necessary and we should only test configuration
provided by the user. Moreover if the block size was already specified
some mkfs utilities does not handle multiple of the same parameters and
the mkfs utility fails making it re-try with only provided options
(ignoring what user specified), which is wrong.

In this case it's also a problem for btrfs file system which does not
support block size < page size.

Fix it by removing the mkfs, and testing existing configuration only.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/generic/017
tests/generic/017.out

index 13b7254d8b2a80ccb84a0890eb36c8042823d92c..5fe46281b7d1670728ea39e8d3546b9c6fe5478b 100755 (executable)
@@ -46,45 +46,31 @@ _require_scratch
 _require_xfs_io_command "fiemap"
 _require_xfs_io_command "fcollapse"
 _do_die_on_error=y
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
 testfile=$SCRATCH_MNT/$seq.$$
 BLOCKS=10240
 
-for (( BSIZE = 1024; BSIZE <= 4096; BSIZE *= 2 )); do
+BSIZE=`get_block_size $SCRATCH_MNT`
 
-       length=$(($BLOCKS * $BSIZE))
-       case $FSTYP in
-       xfs)
-       _scratch_mkfs -b size=$BSIZE >> $seqres.full 2>&1
-       ;;
-       ext4)
-       _scratch_mkfs -b $BSIZE >> $seqres.full 2>&1
-       ;;
-       esac
-       _scratch_mount >> $seqres.full 2>&1
+length=$(($BLOCKS * $BSIZE))
 
-       # Write file
-       $XFS_IO_PROG -f -c "pwrite 0 $length" -c fsync $testfile > /dev/null
+# Write file
+$XFS_IO_PROG -f -c "pwrite 0 $length" -c fsync $testfile > /dev/null
 
-       # Collapse alternate blocks 
-       for (( i = 1; i <= 7; i++ )); do
-               for (( j=0; j < $(($BLOCKS/(2**$i))); j++ )); do
-                       offset=$(($j*$BSIZE))
-                       $XFS_IO_PROG -c "fcollapse $offset $BSIZE" $testfile > /dev/null
-               done
+# Collapse alternate blocks 
+for (( i = 1; i <= 7; i++ )); do
+       for (( j=0; j < $(($BLOCKS/(2**$i))); j++ )); do
+               offset=$(($j*$BSIZE))
+               $XFS_IO_PROG -c "fcollapse $offset $BSIZE" $testfile > /dev/null
        done
-
-       # Check if 80 extents are present
-       $XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l
-
-       _check_scratch_fs
-       if [ $? -ne 0 ]; then
-               status=1
-               exit
-       fi
-
-       umount $SCRATCH_MNT
 done
 
+# Check if 80 extents are present
+$XFS_IO_PROG -c "fiemap -v" $testfile | grep "^ *[0-9]*:" |wc -l
+
 # success, all done
 status=0
 exit
index cc524ac5c63a2869ad6d22cfd42f330fa1062755..ea9a7a8e25bb31dc12eadecc7f2f7cbeb71e13e1 100644 (file)
@@ -1,4 +1,2 @@
 QA output created by 017
 80
-80
-80