[PATCH] generic/765: modify some steps to fix test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that multi-block atomics writes are supported, some of the test steps
are failing. Those steps relied on supporting single-block atomic writes
only.

The current test steps are as follows:
a. Ensure statx for bdev returns same awu_min/max as from sysfs
b. test mkfs for each size of bdev atomic writes capabilities and supported
   FS block size
c. Ensure atomic limits for file match block size for each in b.
d. Ensure that we can atomic write block size for each in b.
e. Ensure that we cannot write file for 2* bdev awu_max or bdev awu_max /2

Make test pass again by:
1. Modify c. to ensure file awu_max >= block size
2. dropping e. We already have tests to ensure that we can only write a
   size >= awu_min and <= awu_max in generic/767

Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>

diff --git a/tests/generic/765 b/tests/generic/765
index 71604e5e..8c4e0bd0 100755
--- a/tests/generic/765
+++ b/tests/generic/765
@@ -84,8 +84,8 @@ test_atomic_writes()
     # Check that atomic min/max = FS block size
     test $file_min_write -eq $bsize || \
         echo "atomic write min $file_min_write, should be fs block size $bsize"
-    test $file_max_write -eq $bsize || \
-        echo "atomic write max $file_max_write, should be fs block size $bsize"
+    test $file_max_write -ge $bsize || \
+        echo "atomic write max $file_max_write, should be at least fs block size $bsize"
     test $file_max_segments -eq 1 || \
         echo "atomic write max segments $file_max_segments, should be 1"
 
@@ -94,34 +94,6 @@ test_atomic_writes()
     _scratch_unmount
 }
 
-test_atomic_write_bounds()
-{
-    local bsize=$1
-
-    get_mkfs_opts $bsize
-    _scratch_mkfs $mkfs_opts >> $seqres.full
-    _scratch_mount
-
-    test "$FSTYP" = "xfs" && _xfs_force_bdev data $SCRATCH_MNT
-
-    testfile=$SCRATCH_MNT/testfile
-    touch $testfile
-
-    file_min_write=$(_get_atomic_write_unit_min $testfile)
-    file_max_write=$(_get_atomic_write_unit_max $testfile)
-    file_max_segments=$(_get_atomic_write_segments_max $testfile)
-
-    echo "test awb $bsize --------------" >> $seqres.full
-    echo "file awu_min $file_min_write" >> $seqres.full
-    echo "file awu_max $file_max_write" >> $seqres.full
-    echo "file awu_segments $file_max_segments" >> $seqres.full
-
-    $XFS_IO_PROG -dc "pwrite -A -D -V1 -b $bsize 0 $bsize" $testfile 2>> $seqres.full && \
-        echo "atomic write should fail when bsize is out of bounds"
-
-    _scratch_unmount
-}
-
 sys_min_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_min_bytes")
 sys_max_write=$(cat "/sys/block/$(_short_dev $SCRATCH_DEV)/queue/atomic_write_unit_max_bytes")
 
@@ -150,14 +122,6 @@ for ((bsize=$bdev_min_write; bsize<=bdev_max_write; bsize*=2)); do
     fi
 done;
 
-# Check that atomic write fails if bsize < bdev min or bsize > bdev max
-if [ $((bdev_min_write / 2)) -ge "$min_bsize" ]; then
-    test_atomic_write_bounds $((bdev_min_write / 2))
-fi
-if [ $((bdev_max_write * 2)) -le "$max_bsize" ]; then
-    test_atomic_write_bounds $((bdev_max_write * 2))
-fi
-
 # success, all done
 echo Silence is golden
 status=0
-- 
2.43.5





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux