From d963068bd704473240073390a5fc8a9630dff60a Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Tue, 28 Jul 2020 19:14:52 +0900 Subject: [PATCH] zbd/002: Check write pointers only when zones have valid conditions 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 Reviewed-by: Klaus Jensen Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/002 | 7 +++++-- tests/zbd/rc | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/zbd/002 b/tests/zbd/002 index a134434..39c2ad5 100755 --- a/tests/zbd/002 +++ b/tests/zbd/002 @@ -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 diff --git a/tests/zbd/rc b/tests/zbd/rc index 3fd2d36..1237363 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -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" -- 2.49.0