All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-cli: Fix to the logic of the nvme list-ns <device> -a command.
@ 2017-07-09  0:36 Chaitanya Kulkarni
  2017-07-10  5:44 ` Sagi Grimberg
  2017-07-10  8:07 ` Guan Junxiong
  0 siblings, 2 replies; 5+ messages in thread
From: Chaitanya Kulkarni @ 2017-07-09  0:36 UTC (permalink / raw)


This fix will reverse the logic of the -a parm in the nvme list-ns
command. Currently, the -a option only shows the attached namespaces
and not all the namespaces. By removing the extra ! it will show attached
inactive namespaces with -a option as mentioned in the help text.

Example : Controller has 3 namespaces, two of them are not attached.

Default exection with ?!!? :-
$ nvme list-ns  /dev/nvme0 -a
[   0]:0x1

Execution with ?!? :-
 nvme list-ns  /dev/nvme0 -a
[   0]:0x1
[   1]:0x2
[   2]:0x3

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at hgst.com>
---
 nvme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nvme.c b/nvme.c
index d64d042..a3abff0 100644
--- a/nvme.c
+++ b/nvme.c
@@ -560,7 +560,7 @@ static int list_ns(int argc, char **argv, struct command *cmd, struct plugin *pl
 	if (fd < 0)
 		return fd;
 
-	err = nvme_identify_ns_list(fd, cfg.namespace_id, !!cfg.all, ns_list);
+	err = nvme_identify_ns_list(fd, cfg.namespace_id, !cfg.all, ns_list);
 	if (!err) {
 		for (i = 0; i < 1024; i++)
 			if (ns_list[i])
-- 
2.7.4

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

end of thread, other threads:[~2017-07-10 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-09  0:36 [PATCH] nvme-cli: Fix to the logic of the nvme list-ns <device> -a command Chaitanya Kulkarni
2017-07-10  5:44 ` Sagi Grimberg
2017-07-10  8:07 ` Guan Junxiong
2017-07-10  8:40   ` royy walls
2017-07-10 16:44     ` Keith Busch

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.