All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
To: linux-block@vger.kernel.org, Omar Sandoval <osandov@fb.com>,
	Masato Suzuki <masato.suzuki@wdc.com>,
	Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: Omar Sandoval <osandov@osandov.com>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Subject: [PATCH blktests 2/5] zbd/004: Add zone condition "Closed" for sequential write required zones
Date: Wed, 20 Feb 2019 17:12:28 +0900	[thread overview]
Message-ID: <20190220081231.15366-3-shinichiro.kawasaki@wdc.com> (raw)
In-Reply-To: <20190220081231.15366-1-shinichiro.kawasaki@wdc.com>

The test case zbd/004 executes write operations for two sequential write
required zones across the zone boundary between them. After the write
operation, the second zone has non-zero write pointer. At that status,
the zone can have not only "Implicit Open" condition but also "Closed"
condition based on zone status management logic of the block zoned device.

Add "Closed" condition to the zone condition check logic in zbd/004. Add
ZONE_COND_CLOSED constant definition in zbd/rc.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/zbd/004 | 9 ++++++++-
 tests/zbd/rc  | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/zbd/004 b/tests/zbd/004
index 291626d..ac0cf50 100755
--- a/tests/zbd/004
+++ b/tests/zbd/004
@@ -83,7 +83,14 @@ test_device() {
 	_put_blkzone_report
 	_get_blkzone_report "${TEST_DEV}" || return $?
 	_check_zone_cond "${idx}" "${ZONE_COND_FULL}" || return $?
-	_check_zone_cond "$((idx+1))" "${ZONE_COND_IMPLICIT_OPEN}" || return $?
+	if ((ZONE_CONDS[idx+1] != ZONE_COND_IMPLICIT_OPEN)) && \
+		   ((ZONE_CONDS[idx+1] != ZONE_COND_CLOSED)); then
+		echo -n "Zone ${idx+1} condition is neither "
+		echo -n "${ZONE_COND_ARRAY[ZONE_COND_IMPLICIT_OPEN]} nor "
+		echo -n "${ZONE_COND_ARRAY[ZONE_COND_CLOSED]} "
+		echo "cond: ${ZONE_COND_ARRAY[ZONE_CONDS[idx+1]]}"
+		return 1
+	fi
 	if [[ ${ZONE_WPTRS[idx+1]} -ne ${phys_blk_sectors} ]]; then
 		echo -n "Unexpected write pointer for zone $((idx+1)) "
 		echo "wp: ${ZONE_WPTRS[idx+1]}"
diff --git a/tests/zbd/rc b/tests/zbd/rc
index 1d6f80a..c32bf31 100644
--- a/tests/zbd/rc
+++ b/tests/zbd/rc
@@ -39,6 +39,7 @@ 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_FULL=14
 
 export ZONE_TYPE_ARRAY=(
-- 
2.20.1


  parent reply	other threads:[~2019-02-20  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20  8:12 [PATCH blktests 0/5] Fix failures found with zoned block devices Shin'ichiro Kawasaki
2019-02-20  8:12 ` [PATCH blktests 1/5] block/024: Increase I/O time Shin'ichiro Kawasaki
2019-02-20  8:12 ` Shin'ichiro Kawasaki [this message]
2019-02-20  8:12 ` [PATCH blktests 3/5] check: Add TEST_DEV_PART_SYSFS variable Shin'ichiro Kawasaki
2019-03-04 22:34   ` Omar Sandoval
2019-03-05  1:47     ` Shinichiro Kawasaki
2019-02-20  8:12 ` [PATCH blktests 4/5] common: Add _test_dev_is_partition() helper function Shin'ichiro Kawasaki
2019-03-04 22:36   ` Omar Sandoval
2019-02-20  8:12 ` [PATCH blktests 5/5] zbd: Change sysfs path for partition devices Shin'ichiro Kawasaki
2019-03-04 22:36   ` Omar Sandoval
2019-02-20 18:22 ` [PATCH blktests 0/5] Fix failures found with zoned block devices Omar Sandoval
2019-02-21  2:50   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190220081231.15366-3-shinichiro.kawasaki@wdc.com \
    --to=shinichiro.kawasaki@wdc.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=masato.suzuki@wdc.com \
    --cc=osandov@fb.com \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.