public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/194: fix the exception when run on 4k sector drives
@ 2015-08-18 17:21 Zorro Lang
  2015-08-18 22:28 ` Dave Chinner
  0 siblings, 1 reply; 11+ messages in thread
From: Zorro Lang @ 2015-08-18 17:21 UTC (permalink / raw)
  To: fstests; +Cc: sandeen, Zorro Lang

The below command in "Test 4":

    xfs_io -c "pwrite -S 0x33 -b 512 `expr $blksize \* 2` 512"

will run failed on 4k sector drives. So I use min_alignment size
to replace the hard-code 512.

Also I make sure the blksize won't less than min_alignment size,
after blksize=`expr $pgsize / 8`.

If blksize really less than min_alignment size, I set blksize =
min_alignment size, and for sure the consistency of test result,
I repair pgsize(already not real page size) number according to
the new blksize.

Because IRIX can't use _min_dio_alignment(), so remove it from
supported os list.

At last, make the crc flag be disabled only when blksize=512.

Signed-off-by: Zorro Lang <zlang@redhat.com>
---
 tests/xfs/194 | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/194 b/tests/xfs/194
index e11b459..4491dd4 100755
--- a/tests/xfs/194
+++ b/tests/xfs/194
@@ -42,7 +42,7 @@ _cleanup()
 
 # only xfs supported due to use of xfs_bmap
 _supported_fs xfs
-_supported_os IRIX Linux
+_supported_os Linux
 
 # real QA test starts here
 rm -f $seqres.full
@@ -50,6 +50,16 @@ rm -f $seqres.full
 # For this test we use block size = 1/8 page size
 pgsize=`$here/src/feature -s`
 blksize=`expr $pgsize / 8`
+secsize=`_min_dio_alignment $SCRATCH_DEV`
+
+# The minimal blksize can't less than sector size, So if
+# blksize < secsize, we should adjust blksize and pgsize number.
+# Of course, if we adjust pgsize, pgsize won't equal to the
+# real page size of system.
+if [ $blksize -lt $secsize ];then
+        blksize=$secsize
+        pgsize=`expr $blksize \* 8`
+fi
 
 # Filter out file mountpoint and physical location info
 # Input:
@@ -84,8 +94,13 @@ _require_scratch
 unset MKFS_OPTIONS
 unset XFS_MKFS_OPTIONS
 
-# we need 512 byte block size, so crc's are turned off
-_scratch_mkfs_xfs -m crc=0 -b size=$blksize >/dev/null 2>&1
+# If we use 512 byte block size, can't use crc
+if [ $blksize -eq 512 ];then
+        crcflag=0
+else
+        crcflag=1
+fi
+_scratch_mkfs_xfs -m crc=$crcflag -b size=$blksize >/dev/null 2>&1
 _scratch_mount
 
 # 512b block / 4k page example:
@@ -209,7 +224,7 @@ xfs_io \
 -c "truncate `expr $blksize / 2`" \
 -c "truncate `expr $blksize + 1`" \
 -c "pwrite -S 0x22 -b $blksize `expr $pgsize / 2` $blksize" \
--c "pwrite -S 0x33 -b 512 `expr $blksize \* 2` 512" \
+-c "pwrite -S 0x33 -b $secsize `expr $blksize \* 2` $secsize" \
 -t -d -f $SCRATCH_MNT/testfile4 >> $seqres.full
 
 xfs_bmap -v $SCRATCH_MNT/testfile4 | _filter_bmap
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-08-19  3:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 17:21 [PATCH] xfs/194: fix the exception when run on 4k sector drives Zorro Lang
2015-08-18 22:28 ` Dave Chinner
2015-08-18 22:33   ` Eric Sandeen
2015-08-18 22:43     ` Dave Chinner
2015-08-18 23:03       ` Eric Sandeen
2015-08-19  2:24         ` Zirong Lang
2015-08-19  2:42         ` Dave Chinner
2015-08-19  3:35           ` Eric Sandeen
2015-08-19  3:46           ` Zirong Lang
2015-08-19  2:24   ` Zirong Lang
2015-08-19  2:48     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox