public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH blktests] zbd: do not handle write pointer values as numeric for full zones
@ 2026-02-19 12:22 Shin'ichiro Kawasaki
  2026-02-19 21:35 ` Damien Le Moal
  0 siblings, 1 reply; 4+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-02-19 12:22 UTC (permalink / raw)
  To: linux-block; +Cc: Damien Le Moal, Wilfred Mallawa, Shin'ichiro Kawasaki

After the recent change in util-linux [1], the 'blkzone report' command
no longer reports numeric values for write pointers when zones are in
full condition. Currently, zbd test scripts assume that the write
pointer values are numeric, then the blkzone change triggered failures.
To avoid the failures, check the zone condition and handle the write
pointer values as numeric only when zones are not in the full condition.
Also, drop the "-i" option of the local variable 'wptr' declaration in
zbd/002 so that it can hold non-numerical values.

Link: [1] https://github.com/util-linux/util-linux/commit/b032247f48d8b6a13bf8541eb663c779e448f568
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/zbd/002 |  2 +-
 tests/zbd/rc  | 13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tests/zbd/002 b/tests/zbd/002
index 39c2ad5..ac83c46 100755
--- a/tests/zbd/002
+++ b/tests/zbd/002
@@ -25,7 +25,7 @@ _check_blkzone_report() {
 	local -i next_start=0
 	local -i len=0
 	local -i cap=0
-	local -i wptr=0
+	local wptr=0
 	local -i cond=0
 	local -i zone_type=0
 
diff --git a/tests/zbd/rc b/tests/zbd/rc
index 570928b..921cf62 100644
--- a/tests/zbd/rc
+++ b/tests/zbd/rc
@@ -141,15 +141,22 @@ _get_blkzone_report() {
 	fi
 
 	local _IFS=$IFS
-	local -i loop=0
+	local -i loop=0 cond
 	IFS=$' ,:'
 	while read -r -a _tokens
 	do
 		ZONE_STARTS+=($((_tokens[1])))
 		ZONE_LENGTHS+=($((_tokens[3])))
 		ZONE_CAPS+=($((_tokens[cap_idx])))
-		ZONE_WPTRS+=($((_tokens[wptr_idx])))
-		ZONE_CONDS+=($((${_tokens[conds_idx]%\(*})))
+		# The latest blkzone reports 'N/A' as write pointers for full
+		# zones. In that case, do not handle it as numeric.
+		cond=$((${_tokens[conds_idx]%\(*}))
+		if ((cond == ZONE_COND_FULL)); then
+			ZONE_WPTRS+=("${_tokens[wptr_idx]}")
+		else
+			ZONE_WPTRS+=($((_tokens[wptr_idx])))
+		fi
+		ZONE_CONDS+=("${cond}")
 		ZONE_TYPES+=($((${_tokens[type_idx]%\(*})))
 		if [[ ${ZONE_TYPES[-1]} -eq ${ZONE_TYPE_CONVENTIONAL} ]]; then
 			(( NR_CONV_ZONES++ ))
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH blktests] zbd: do not handle write pointer values as numeric for full zones
@ 2026-02-19 12:19 Shin'ichiro Kawasaki
  0 siblings, 0 replies; 4+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-02-19 12:19 UTC (permalink / raw)
  To: linux-block; +Cc: Shin'ichiro Kawasaki

After the recent change in util-linux [1], the 'blkzone report' command
no longer reports numeric values for write pointers when zones are in
full condition. Currently, zbd test scripts assume that the write
pointer values are numeric, then the blkzone change triggered failures.
To avoid the failures, check the zone condition and handle the write
pointer values as numeric only when zones are not in the full condition.
Also, drop the "-i" option of the local variable 'wptr' declaration in
zbd/002 so that it can hold non-numerical values.

Link: [1] https://github.com/util-linux/util-linux/commit/b032247f48d8b6a13bf8541eb663c779e448f568
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 tests/zbd/002 |  2 +-
 tests/zbd/rc  | 13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tests/zbd/002 b/tests/zbd/002
index 39c2ad5..ac83c46 100755
--- a/tests/zbd/002
+++ b/tests/zbd/002
@@ -25,7 +25,7 @@ _check_blkzone_report() {
 	local -i next_start=0
 	local -i len=0
 	local -i cap=0
-	local -i wptr=0
+	local wptr=0
 	local -i cond=0
 	local -i zone_type=0
 
diff --git a/tests/zbd/rc b/tests/zbd/rc
index 570928b..921cf62 100644
--- a/tests/zbd/rc
+++ b/tests/zbd/rc
@@ -141,15 +141,22 @@ _get_blkzone_report() {
 	fi
 
 	local _IFS=$IFS
-	local -i loop=0
+	local -i loop=0 cond
 	IFS=$' ,:'
 	while read -r -a _tokens
 	do
 		ZONE_STARTS+=($((_tokens[1])))
 		ZONE_LENGTHS+=($((_tokens[3])))
 		ZONE_CAPS+=($((_tokens[cap_idx])))
-		ZONE_WPTRS+=($((_tokens[wptr_idx])))
-		ZONE_CONDS+=($((${_tokens[conds_idx]%\(*})))
+		# The latest blkzone reports 'N/A' as write pointers for full
+		# zones. In that case, do not handle it as numeric.
+		cond=$((${_tokens[conds_idx]%\(*}))
+		if ((cond == ZONE_COND_FULL)); then
+			ZONE_WPTRS+=("${_tokens[wptr_idx]}")
+		else
+			ZONE_WPTRS+=($((_tokens[wptr_idx])))
+		fi
+		ZONE_CONDS+=("${cond}")
 		ZONE_TYPES+=($((${_tokens[type_idx]%\(*})))
 		if [[ ${ZONE_TYPES[-1]} -eq ${ZONE_TYPE_CONVENTIONAL} ]]; then
 			(( NR_CONV_ZONES++ ))
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-20 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-19 12:22 [PATCH blktests] zbd: do not handle write pointer values as numeric for full zones Shin'ichiro Kawasaki
2026-02-19 21:35 ` Damien Le Moal
2026-02-20 11:01   ` Shinichiro Kawasaki
  -- strict thread matches above, loose matches on Subject: below --
2026-02-19 12:19 Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox