* [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
* [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
* Re: [PATCH blktests] zbd: do not handle write pointer values as numeric for full zones
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
0 siblings, 1 reply; 4+ messages in thread
From: Damien Le Moal @ 2026-02-19 21:35 UTC (permalink / raw)
To: Shin'ichiro Kawasaki, linux-block; +Cc: Wilfred Mallawa
On 2/19/26 21:22, Shin'ichiro Kawasaki wrote:
> 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
Missing handling of readonly and offline too. These also have invalid WP.
Anyway, why even look at the output from blkzone for this case ? The WP is
invalid, so its value is "garbage" !
Why not simply something like:
ZONE_WPTRS+=($(( $((_tokens[1])) + $((_tokens[3])))
or just use ULLONG_MAX/-1 for the value. Any value will do. Doing so, you are
not dependent on what blkzone displays for full, readonly and offline zones.
> + 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++ ))
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH blktests] zbd: do not handle write pointer values as numeric for full zones
2026-02-19 21:35 ` Damien Le Moal
@ 2026-02-20 11:01 ` Shinichiro Kawasaki
0 siblings, 0 replies; 4+ messages in thread
From: Shinichiro Kawasaki @ 2026-02-20 11:01 UTC (permalink / raw)
To: Damien Le Moal; +Cc: linux-block@vger.kernel.org, Wilfred Mallawa
On Feb 20, 2026 / 06:35, Damien Le Moal wrote:
> On 2/19/26 21:22, Shin'ichiro Kawasaki wrote:
> > 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
>
> Missing handling of readonly and offline too. These also have invalid WP.
That's right. And I noticed that the latest blkzone reports "N/A" as write
pointers for conventional zones also. Then the above part will need to check
zone type also.
>
> Anyway, why even look at the output from blkzone for this case ? The WP is
> invalid, so its value is "garbage" !
> Why not simply something like:
>
> ZONE_WPTRS+=($(( $((_tokens[1])) + $((_tokens[3])))
>
> or just use ULLONG_MAX/-1 for the value. Any value will do. Doing so, you are
> not dependent on what blkzone displays for full, readonly and offline zones.
That sounds good. I will revise this patch to -1 in v2.
^ permalink raw reply [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