xfs/300: modify test to work on any fs block size
authorJeff Moyer <jmoyer@redhat.com>
Thu, 20 Feb 2020 20:06:32 +0000 (15:06 -0500)
committerEryu Guan <guaneryu@gmail.com>
Fri, 6 Mar 2020 07:55:39 +0000 (15:55 +0800)
The test currently assumes a file system block size of 4k.  It will
work just fine on any user-specified block size, though.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/300

index 28608b811897b462fb0eb26625ae580b6453ab5f..4f1c927a76d3d0dc701ab0b2c2d4aa8eba19501c 100755 (executable)
@@ -50,8 +50,9 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 0 4096" $SCRATCH_MNT/attrvals >> $seqres.full
 cat $SCRATCH_MNT/attrvals | attr -s name $SCRATCH_MNT/$seq.test >> $seqres.full 2>&1
 
 # Fragment the file by writing backwards
+bs=$(_get_file_block_size $SCRATCH_MNT)
 for I in `seq 6 -1 0`; do
-       dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=4k \
+       dd if=/dev/zero of=$SCRATCH_MNT/$seq.test seek=$I bs=${bs} \
           oflag=direct count=1 conv=notrunc >> $seqres.full 2>&1
 done