]> www.infradead.org Git - users/hch/blktests.git/commitdiff
block/004: Provide max_active_zones to fio command
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Thu, 1 Oct 2020 10:15:30 +0000 (19:15 +0900)
committerOmar Sandoval <osandov@fb.com>
Thu, 22 Oct 2020 21:36:31 +0000 (14:36 -0700)
If the test target devices is a zoned block device with max_active_zones
limit, the fio command in block/004 opens zones beyond the limit and
fails with I/O errors.

To avoid the failure, pass the limit value to fio using --max_open_zones
option. This option, which was introduced to fio together with
zonemode=zbd, keeps the number of open zones within the specified value.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/block/004

index d181725e6f80d4f58b1e9bfae4601fd0fca8a5d9..6eff6ceee44e4feb3a7467ba1b2e8d04c90be100 100755 (executable)
@@ -21,19 +21,18 @@ device_requires() {
 test_device() {
        echo "Running ${TEST_NAME}"
 
-       local directio=""
-       local zbdmode=""
+       local -a opts=()
 
        if _test_dev_is_zoned; then
                _test_dev_queue_set scheduler deadline
-               directio="--direct=1"
-               zbdmode="--zonemode=zbd"
+               opts+=("--direct=1" "--zonemode=zbd")
+               opts+=("--max_open_zones=$(_test_dev_max_active_zones)")
        fi
 
        FIO_PERF_FIELDS=("write iops")
        _fio_perf --bs=4k --rw=randwrite --norandommap --fsync=1 \
                --number_ios=256 --numjobs=64 --name=flushes \
-               ${directio} ${zbdmode} --filename="$TEST_DEV"
+               "${opts[@]}" --filename="$TEST_DEV"
 
        echo "Test complete"
 }