]> www.infradead.org Git - users/hch/blktests.git/commitdiff
zbd/004: Check zone boundary writes using zones without zone capacity gap
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 28 Jul 2020 10:14:50 +0000 (19:14 +0900)
committerOmar Sandoval <osandov@fb.com>
Tue, 4 Aug 2020 20:56:14 +0000 (13:56 -0700)
The test case zbd/004 checks zone boundary write handling by block layer
using two contiguous sequential write required zones. This test is valid
when the first zone has same zone capacity as zone size. However, if the
zone has zone capacity smaller than zone size, the write in the zone
beyond zone capacity limit causes write error and the test fails.

To avoid the write error, find the two zones with first zone that has
zone capacity same as zone size. If such zones are not found, skip the
test case.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
tests/zbd/004
tests/zbd/rc

index ac0cf50c7d7233339f6c6b6d910099cc7a7e5e64..f09ee31a72d78d6e1727838372f157e8d9eab1ad 100755 (executable)
@@ -46,7 +46,11 @@ test_device() {
 
        # Find target sequential required zones and reset write pointers
        _get_blkzone_report "${TEST_DEV}" || return $?
-       idx=$(_find_two_contiguous_seq_zones) || return $?
+       if ! idx=$(_find_two_contiguous_seq_zones cap_eq_len); then
+               SKIP_REASON="No contiguous sequential write required zones"
+               _put_blkzone_report
+               return
+       fi
        _reset_zones "${TEST_DEV}" "${idx}" "2"
 
        # Confirm the zones are initialized
index dafd13050af32b896fa13ee63c24a77378d6936b..3fd2d3683c08264aa453834b61a0e85e5994fd2b 100644 (file)
@@ -253,21 +253,28 @@ _find_sequential_zone_in_middle() {
        return 1
 }
 
-# Search zones and find two contiguous sequential required zones.
+# Search zones and find two contiguous sequential write required zones.
 # Return index of the first zone of the found two zones.
+# When the argument cap_eq_len is specified, find the two contiguous
+# sequential write required zones with first zone that has zone capacity
+# same as zone size.
 # Call _get_blkzone_report() beforehand.
 _find_two_contiguous_seq_zones() {
+       local cap_eq_len="${1}"
        local -i type_seq=${ZONE_TYPE_SEQ_WRITE_REQUIRED}
 
        for ((idx = NR_CONV_ZONES; idx < REPORTED_COUNT; idx++)); do
                if [[ ${ZONE_TYPES[idx]} -eq ${type_seq} &&
                      ${ZONE_TYPES[idx+1]} -eq ${type_seq} ]]; then
+                       if [[ -n ${cap_eq_len} ]] &&
+                                  ((ZONE_CAPS[idx] != ZONE_LENGTHS[idx])); then
+                               continue
+                       fi
                        echo "${idx}"
                        return 0
                fi
        done
 
-       echo "Contiguous sequential write required zones not found"
        return 1
 }