t/zbd: Avoid inappropriate blkzone command call in zone_cap_bs
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 14 Dec 2021 01:24:13 +0000 (10:24 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 14 Dec 2021 13:48:14 +0000 (06:48 -0700)
commit9ffe433d729101a34d9709030d7d4dd2444347ef
tree0023acb665e3360294efb86252d4b9155f0028f4
parent53aa61719b906bdf8e058c94ca93e537b90806b1
t/zbd: Avoid inappropriate blkzone command call in zone_cap_bs

When the script test-zbd-support is run for regular block devices or
SG nodes, blkzone command shall not be called. However, zone_cap_bs()
helper function calls the command regardless of the zone model or
device type, and results in error messages such as "unable to determine
zone size" or "not a block device". Avoid the command call by returning
the zone size argument passed to this function when the test device is
a regular block device or a SG node.

Fixes: 1ae82d673cf5 ("t/zbd: Align block size to zone capacity")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20211214012413.464798-13-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/functions