@@ -280,11 +280,24 @@ _test_dev_is_partition() {
[[ -n ${TEST_DEV_PART_SYSFS} ]]
}
-_test_dev_max_active_zones() {
+# Return max open zones or max active zones of the test target device.
+# If the device has both, return smaller value.
+_test_dev_max_open_active_zones() {
+ local -i moz=0
+ local -i maz=0
+
+ if [[ -r "${TEST_DEV_SYSFS}/queue/max_open_zones" ]]; then
+ moz=$(_test_dev_queue_get max_open_zones)
+ fi
+
if [[ -r "${TEST_DEV_SYSFS}/queue/max_active_zones" ]]; then
- _test_dev_queue_get max_active_zones
+ maz=$(_test_dev_queue_get max_active_zones)
+ fi
+
+ if ((!moz)) || ((maz && maz < moz)); then
+ echo "${maz}"
else
- echo 0
+ echo "${moz}"
fi
}
@@ -26,7 +26,7 @@ test_device() {
if _test_dev_is_zoned; then
_test_dev_queue_set scheduler deadline
opts+=("--direct=1" "--zonemode=zbd")
- opts+=("--max_open_zones=$(_test_dev_max_active_zones)")
+ opts+=("--max_open_zones=$(_test_dev_max_open_active_zones)")
fi
FIO_PERF_FIELDS=("write iops")
@@ -30,10 +30,10 @@ test_device() {
echo "Running ${TEST_NAME}"
- # When the test device has max_active_zone limit, reset all zones. This
- # ensures the write operations in this test case do not open zones
+ # When the test device has max_open/active_zones limit, reset all zones.
+ # This ensures the write operations in this test case do not open zones
# beyond the limit.
- (($(_test_dev_max_active_zones))) && blkzone reset "${TEST_DEV}"
+ (($(_test_dev_max_open_active_zones))) && blkzone reset "${TEST_DEV}"
# Get physical block size as dd block size to meet zoned block device
# requirement