]> www.infradead.org Git - users/sagi/blktests.git/commitdiff
block/004: reset zones of TEST_DEV before fio operation
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 4 Aug 2023 12:20:07 +0000 (21:20 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 11 Aug 2023 01:53:26 +0000 (10:53 +0900)
When test target is a zoned block device with max_active_zones limit
larger than max_open_zones, fio write operation may fail depending on
zone conditions. To avoid the failure, reset zones of the device before
the fio run.

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

index 63484a458e071622042e20bd319d5cc4aed4cda5..52a260f2407e4cd300fe928e9d28b510abd150d5 100755 (executable)
@@ -15,7 +15,10 @@ requires() {
 }
 
 device_requires() {
-       ! _test_dev_is_zoned || _have_fio_zbd_zonemode
+       if _test_dev_is_zoned; then
+               _have_fio_zbd_zonemode
+               _have_program blkzone
+       fi
 }
 
 test_device() {
@@ -24,6 +27,7 @@ test_device() {
        local -a opts=()
 
        if _test_dev_is_zoned; then
+               blkzone reset "$TEST_DEV"
                _test_dev_set_scheduler deadline
                opts+=("--direct=1" "--zonemode=zbd")
                opts+=("--max_open_zones=$(_test_dev_max_open_active_zones)")