summaryrefslogtreecommitdiffstats
path: root/block/sed-opal.c
diff options
context:
space:
mode:
authorScott Bauer <scott.bauer@intel.com>2017-02-22 18:15:08 +0100
committerJens Axboe <axboe@fb.com>2017-02-23 19:55:44 +0100
commit2d19020b085eaf61d24377db27e8630cd9cff7ce (patch)
tree6423a5ec0b75faf1975bfbe13147c4f0defdacb8 /block/sed-opal.c
parentnvme/pci: re-check security protocol support after reset (diff)
downloadlinux-2d19020b085eaf61d24377db27e8630cd9cff7ce.tar.xz
linux-2d19020b085eaf61d24377db27e8630cd9cff7ce.zip
block/sed-opal: Propagate original error message to userland.
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> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/sed-opal.c')
-rw-r--r--block/sed-opal.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/block/sed-opal.c b/block/sed-opal.c
index 020bf3e28e38..1e18dca360fc 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);