fstests: Fix buffer alignment of aiocp

In generic/252, aiocp with DIRECT will fail and return EINVAL on
4096 sector size block device, because the default 512 alignment
defined in aiocp is not aligned with 4096.

Please see the following error:
----------------------------------------------------------
read missing bytes expect 8388608 got -22
----------------------------------------------------------

We use '-a' option to specify a proper alignment size in all tests
that call aiocp with DIRECT.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Xiao Yang
2018-08-15 13:41:45 +08:00
committed by Eryu Guan
parent 55566e7f7c
commit 84fdfc5d8a
5 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -59,6 +59,7 @@ nr=640
bufnr=128
filesize=$((blksz * nr))
bufsize=$((blksz * bufnr))
alignment=`_min_dio_alignment $TEST_DEV`
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 5 / 4))
@@ -75,7 +76,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full
sync
_dmerror_load_error_table
$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
+2 -1
View File
@@ -51,6 +51,7 @@ nr=640
bufnr=128
filesize=$((blksz * nr))
bufsize=$((blksz * bufnr))
alignment=`_min_dio_alignment $TEST_DEV`
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
@@ -69,7 +70,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full
sync
_dmerror_load_error_table
$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
+2 -1
View File
@@ -47,6 +47,7 @@ nr=640
bufnr=128
filesize=$((blksz * nr))
bufsize=$((blksz * bufnr))
alignment=`_min_dio_alignment $TEST_DEV`
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
@@ -63,7 +64,7 @@ echo "CoW and unmount"
$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full
sync
$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full
$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
_scratch_cycle_mount
echo "Compare files"
+2 -1
View File
@@ -53,6 +53,7 @@ nr=640
bufnr=128
filesize=$((blksz * nr))
bufsize=$((blksz * bufnr))
alignment=`_min_dio_alignment $TEST_DEV`
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
@@ -72,7 +73,7 @@ $XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full
sync
_dmerror_load_error_table
$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
_dmerror_load_working_table
_dmerror_unmount
_dmerror_mount
+2 -1
View File
@@ -51,6 +51,7 @@ filesize=$((blksz * nr))
bufsize=$((blksz * bufnr))
filesize=$filesize
bufsize=$bufsize
alignment=`_min_dio_alignment $TEST_DEV`
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
@@ -68,7 +69,7 @@ echo "CoW and unmount"
$XFS_IO_PROG -f -c "pwrite -S 0x63 $bufsize 1" $testdir/file2 >> $seqres.full
sync
$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $TEST_DIR/moo >> $seqres.full
$AIO_TEST -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
$AIO_TEST -a $alignment -f DIRECT -b $bufsize $TEST_DIR/moo $testdir/file2 >> $seqres.full
_scratch_cycle_mount
echo "Compare files"