Skip to content

Commit

Permalink
block/sed-opal: Propagate original error message to userland.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Bauer authored and axboe committed Feb 23, 2017
1 parent e286bcf commit 2d19020
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions block/sed-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2d19020

Please sign in to comment.