From: Wilfred Mallawa Date: Mon, 23 Feb 2026 23:43:29 +0000 (+1000) Subject: blkzone: add more checks when printing zone write_pointer X-Git-Tag: v2.43-devel~45^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01a97295b47d49a676c5c6238536ead5ae7e9124;p=thirdparty%2Futil-linux.git blkzone: add more checks when printing zone write_pointer The zone write pointer is also invalid for READONLY and OFFLINE zones, so handle such cases appropriately by not displaying a write pointer for READONLY and OFFLINE zones. Signed-off-by: Wilfred Mallawa Fixes: b032247f48 ("blkzone: don't show wptr when zones are full") --- diff --git a/sys-utils/blkzone.c b/sys-utils/blkzone.c index 1b5932fb2..65b9cc42a 100644 --- a/sys-utils/blkzone.c +++ b/sys-utils/blkzone.c @@ -291,7 +291,10 @@ static int blkzone_report(struct blkzone_control *ctl) cap = entry.len; if (type == BLK_ZONE_TYPE_CONVENTIONAL || - cond == BLK_ZONE_COND_FULL) + (cond == BLK_ZONE_COND_FULL || + cond == BLK_ZONE_COND_READONLY || + cond == BLK_ZONE_COND_OFFLINE || + cond == BLK_ZONE_COND_NOT_WP)) snprintf(wp_str, sizeof(wp_str), "%s", _("N/A")); else snprintf(wp_str, sizeof(wp_str),