From: Shin'ichiro Kawasaki Date: Thu, 1 Oct 2020 10:15:30 +0000 (+0900) Subject: block/004: Provide max_active_zones to fio command X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d533a5944c08a67d3858c0728d33a9c0bffbd8b5;p=users%2Fhch%2Fblktests.git block/004: Provide max_active_zones to fio command 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 Signed-off-by: Shin'ichiro Kawasaki --- diff --git a/tests/block/004 b/tests/block/004 index d181725..6eff6ce 100755 --- a/tests/block/004 +++ b/tests/block/004 @@ -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" }