Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: dmilburn@redhat.com (David Milburn)
Subject: [PATCH] nvme-cli: report subsystem-reset not supported by controller
Date: Thu, 31 May 2018 14:07:47 -0500	[thread overview]
Message-ID: <1527793667-14356-1-git-send-email-dmilburn@redhat.com> (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

                 reply	other threads:[~2018-05-31 19:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1527793667-14356-1-git-send-email-dmilburn@redhat.com \
    --to=dmilburn@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox