generic/095: align DIO read/writes with the supported sector size for the device
authorLuís Henriques <lhenriques@suse.de>
Mon, 11 Oct 2021 15:11:16 +0000 (16:11 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 24 Oct 2021 13:25:36 +0000 (21:25 +0800)
This test creates fio DIO jobs with bs=1k, which will fail when using block
devices that have logical sector size bigger than 1k (such as zram, advanced
format HDD's with 4k sectors, DASD's on mainframes with 2k sectors, etc).

Fix the test by using _min_dio_alignment instead to get the correct size.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/095

index c4693917b3e149e2c3ff1e18bf42c5d85c18f671..80448200bb8629ba0a95bd6012d96fb2875bef03 100755 (executable)
@@ -23,6 +23,7 @@ iodepth_batch=$((8 * LOAD_FACTOR))
 numjobs=$((5 * LOAD_FACTOR))
 fio_config=$tmp.fio
 fio_out=$tmp.fio.out
+blksz=$(_min_dio_alignment $SCRATCH_DEV)
 cat >$fio_config <<EOF
 [global]
 bs=8k
@@ -34,7 +35,7 @@ directory=$SCRATCH_MNT
 numjobs=$numjobs
 [job1]
 ioengine=sync
-bs=1k
+bs=$blksz
 direct=1
 rw=randread
 filename=file1:file2
@@ -44,7 +45,7 @@ rw=randwrite
 direct=1
 filename=file1:file2
 [job3]
-bs=1k
+bs=$blksz
 ioengine=posixaio
 rw=randwrite
 direct=1