All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@wdc.com>
To: util-linux@vger.kernel.org, Karel Zak <kzak@redhat.com>,
	Benno Schulenberg <bensberg@justemail.net>
Cc: Bart Van Assche <Bart.VanAssche@sandisk.com>,
	Damien Le Moal <damien.lemoal@wdc.com>
Subject: [PATCH] blkzone: Fix zone condition strings handling
Date: Wed, 12 Apr 2017 18:20:32 +0900	[thread overview]
Message-ID: <20170412092032.7234-1-damien.lemoal@wdc.com> (raw)

Fixed the condition strings for implicit open and explicit open to
match the man page defined strings ("oi" and "oe"). Also while at it,
correct the condition_str array entries adding the reserved "xC" case
so that the read_only, full and offline conditions match the condition
codes. This increases the array size to 16, so also fix the condition
code masking when displaying the result.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 sys-utils/blkzone.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys-utils/blkzone.c b/sys-utils/blkzone.c
index 1457225..7713ff3 100644
--- a/sys-utils/blkzone.c
+++ b/sys-utils/blkzone.c
@@ -151,10 +151,10 @@ static const char *type_text[] = {
 static const char *condition_str[] = {
 	"nw", /* Not write pointer */
 	"em", /* Empty */
-	"io", /* Implicitly opened */
-	"eo", /* Explicitly opened */
+	"oi", /* Implicitly opened */
+	"oe", /* Explicitly opened */
 	"cl", /* Closed */
-	"x5", "x6", "x7", "x8", "x9", "xA", "xB", /* xN: reserved */
+	"x5", "x6", "x7", "x8", "x9", "xA", "xB", "xC", /* xN: reserved */
 	"ro", /* Read only */
 	"fu", /* Full */
 	"of"  /* Offline */
@@ -220,7 +220,7 @@ static int blkzone_report(struct blkzone_control *ctl)
 			 	" reset:%u non-seq:%u, zcond:%2u(%s) [type: %u(%s)]\n"),
 				start, len, (type == 0x1) ? 0 : wp - start,
 				entry->reset, entry->non_seq,
-				cond, condition_str[cond & ARRAY_SIZE(condition_str)],
+				cond, condition_str[cond & (ARRAY_SIZE(condition_str) - 1)],
 				type, type_text[type]);
 
 			nr_zones--;
-- 
2.9.3


             reply	other threads:[~2017-04-12  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  9:20 Damien Le Moal [this message]
2017-04-18  9:34 ` [PATCH] blkzone: Fix zone condition strings handling Karel Zak
2017-04-18 10:59   ` 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=20170412092032.7234-1-damien.lemoal@wdc.com \
    --to=damien.lemoal@wdc.com \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=bensberg@justemail.net \
    --cc=kzak@redhat.com \
    --cc=util-linux@vger.kernel.org \
    /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.