From: Scott Bauer <scott.bauer@intel.com>
To: linux-block@vger.kernel.org
Cc: keith.busch@intel.com, linux-nvme@lists.infradead.org,
axboe@fb.com, jonathan.derrick@intel.com, hch@lst.de,
Scott Bauer <scott.bauer@intel.com>
Subject: [PATCH 3/3] block/sed-opal: Propagate original error message to userland.
Date: Wed, 22 Feb 2017 10:15:08 -0700 [thread overview]
Message-ID: <1487783708-16285-4-git-send-email-scott.bauer@intel.com> (raw)
In-Reply-To: <1487783708-16285-1-git-send-email-scott.bauer@intel.com>
During an error on a comannd, ex: user provides wrong pw to unlock
range, we will gracefully terminate the opal session. We want to
propagate the original error to userland instead of the result of
the session termination, which is almost always a success.
Signed-off-by: Scott Bauer <scott.bauer@intel.com>
---
block/sed-opal.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/sed-opal.c b/block/sed-opal.c
index 020bf3e..1e18dca 100644
--- a/block/sed-opal.c
+++ b/block/sed-opal.c
@@ -396,8 +396,11 @@ static int next(struct opal_dev *dev)
* session. Therefore we shouldn't attempt to terminate
* a session, as one has not yet been created.
*/
- if (state > 1)
- return end_opal_session_error(dev);
+ if (state > 1) {
+ end_opal_session_error(dev);
+ return error;
+ }
+
}
state++;
} while (!error);
--
2.7.4
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2017-02-22 17:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 17:15 Final opal patches for rc1 Scott Bauer
2017-02-22 17:15 ` [PATCH 1/3] block/sed-opal: Introduce free_opal_dev to free the structure and clean up state Scott Bauer
2017-02-22 17:15 ` [PATCH 2/3] nvme/pci: re-check security protocol support after reset Scott Bauer
2017-02-22 17:15 ` Scott Bauer [this message]
2017-02-23 18:57 ` Final opal patches for rc1 Jens Axboe
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=1487783708-16285-4-git-send-email-scott.bauer@intel.com \
--to=scott.bauer@intel.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=jonathan.derrick@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).