Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-cli: report subsystem-reset not supported by controller
@ 2018-05-31 19:07 David Milburn
  0 siblings, 0 replies; only message in thread
From: David Milburn @ 2018-05-31 19:07 UTC (permalink / raw)


Add a little more description for "nvme subsystem-reset"
failures, currently driver reports "Inappropriate ioctl
for device".

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: Inappropriate ioctl for device

With this change report controller doesn't support
NVM Subsystem Reset.

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: NVM Subsystem Reset not supported.
---
 nvme.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nvme.c b/nvme.c
index a065e5d..2798e4b 100644
--- a/nvme.c
+++ b/nvme.c
@@ -2154,7 +2154,10 @@ static int subsystem_reset(int argc, char **argv, struct command *cmd, struct pl
 	err = nvme_subsystem_reset(fd);
 	if (err < 0) {
 		close(fd);
-		perror("Subsystem-reset");
+		if (errno == ENOTTY)
+			fprintf(stderr, "Subsystem-reset: NVM Subsystem Reset not supported.\n");
+		else
+			perror("Subsystem-reset");
 		return errno;
 	}
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-31 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-31 19:07 [PATCH] nvme-cli: report subsystem-reset not supported by controller David Milburn

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