]> www.infradead.org Git - users/hch/blktests.git/commitdiff
zbd/002: Check write pointers only when zones have valid conditions
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 28 Jul 2020 10:14:52 +0000 (19:14 +0900)
committerOmar Sandoval <osandov@fb.com>
Tue, 4 Aug 2020 20:56:14 +0000 (13:56 -0700)
Per ZBC, ZAC and ZNS specifications, when zones have condition "read
only", "full" or "offline", the zones may not have valid write pointers.
In such a case, do not check validity of write pointers.

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/002
tests/zbd/rc

index a134434f6849dffe1348adcb0f813b4c765e80f7..39c2ad566f047075fb7287a997f8228d3d73c11a 100755 (executable)
@@ -80,9 +80,12 @@ _check_blkzone_report() {
                fi
 
                # Check write pointer
-               if [[ ${wptr} -lt 0 || ${wptr} -gt ${len} ]]; then
+               if ((cond != ZONE_COND_READ_ONLY &&
+                    cond != ZONE_COND_FULL &&
+                    cond != ZONE_COND_OFFLINE &&
+                    (wptr < 0 || wptr > len) )); then
                        echo -n "Write pointer is invalid at zone ${idx}. "
-                       echo "wp:${wptr}"
+                       echo "wp:${wptr}, cond:${cond}"
                        return 1
                fi
 
index 3fd2d3683c08264aa453834b61a0e85e5994fd2b..12373632ee129ffea6e753d5a3299e87a1ba2c78 100644 (file)
@@ -41,7 +41,9 @@ export ZONE_TYPE_SEQ_WRITE_PREFERRED=3
 export ZONE_COND_EMPTY=1
 export ZONE_COND_IMPLICIT_OPEN=2
 export ZONE_COND_CLOSED=4
+export ZONE_COND_READ_ONLY=13
 export ZONE_COND_FULL=14
+export ZONE_COND_OFFLINE=15
 
 export ZONE_TYPE_ARRAY=(
        [1]="CONVENTIONAL"