[PATCH blktests 3/3] zbd/003: Reset zones when the test device has max_active_zones limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the test target device has the max_active_zones limit, write
operations by test case zbd/003 may open zones beyond the limit and
trigger write failures.

To avoid the failure, check max_active_zones limit of the test target
device. If the limit is valid, reset all zones of the device at test
start to ensure that number of open zones does not exceed the limit.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
---
 tests/zbd/003 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/zbd/003 b/tests/zbd/003
index 079be02..1e92e81 100755
--- a/tests/zbd/003
+++ b/tests/zbd/003
@@ -30,6 +30,11 @@ 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
+	# beyond the limit.
+	(($(_test_dev_max_active_zones))) && blkzone reset "${TEST_DEV}"
+
 	# Get physical block size as dd block size to meet zoned block device
 	# requirement
 	_get_sysfs_variable "${TEST_DEV}" || return $?
-- 
2.26.2




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux