]> www.infradead.org Git - users/hch/blktests.git/commit
common/rc: Check both max_active_zones and max_open_zones
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 29 Dec 2020 00:44:33 +0000 (09:44 +0900)
committerOmar Sandoval <osandov@fb.com>
Mon, 4 Jan 2021 22:57:17 +0000 (14:57 -0800)
commitad6f4b8f617d59946444b8689619e6679227e9f5
tree2000cce0b76ace764933ea1eb874d78eb8c7160d
parent10838a67750239ec7ba19127bf013ea8ec7963b7
common/rc: Check both max_active_zones and max_open_zones

Linux kernel 5.9 introduced new sysfs attributes max_active_zones and
max_open_zones for zoned block devices. Max_open_zones is the limit of
number of zones in open status. Max_active_zones is the limit of number
of zones in open or closed status. Currently, the helper function
_test_dev_max_active_zones() checks only max_active_zones, but it is not
enough. When the device has max_open_zones, check for max_active_zones
can not avoid the errors for write operations.

To avoid the error, improve the function _test_dev_max_active_zones() to
check the limits both. Rename it to _test_dev_max_open_active_zones().
When one of the limits is available for the test target device, return
it. If both limits are available, return smaller limit.

Also modify block/004 and zbd/003 to call the renamed helper function
and update comment description.

Fixes: e6981bb2d9ce ("common/rc: Add _test_dev_max_active_zones() helper function")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
common/rc
tests/block/004
tests/zbd/003