t/zbd: Avoid inappropriate blkzone command call in zone_cap_bs
[fio.git] / t / zbd / functions
index e4e248b9ff26a0c99fe564598455ab4a86d5ac5f..7cff18fd18c0b50ae7ccf961fa665402d258ca71 100644 (file)
@@ -72,9 +72,11 @@ zone_cap_bs() {
        local sed_str='s/.*len \([0-9A-Za-z]*\), cap \([0-9A-Za-z]*\).*/\1 \2/p'
        local cap bs="$zone_size"
 
-       # When blkzone is not available or blkzone does not report capacity,
+       # When blkzone command is neither available nor relevant to the
+       # test device, or when blkzone command does not report capacity,
        # assume that zone capacity is same as zone size for all zones.
-       if [ -z "${blkzone}" ] || ! blkzone_reports_capacity "${dev}"; then
+       if [ -z "${blkzone}" ] || [ -z "$is_zbd" ] || [ -c "$dev" ] ||
+                  ! blkzone_reports_capacity "${dev}"; then
                echo "$zone_size"
                return
        fi