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>
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"
}