Skip to content

Commit 2d19020

Browse files
Scott Baueraxboe
authored andcommitted
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>
1 parent e286bcf commit 2d19020

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

block/sed-opal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,11 @@ static int next(struct opal_dev *dev)
396396
* session. Therefore we shouldn't attempt to terminate
397397
* a session, as one has not yet been created.
398398
*/
399-
if (state > 1)
400-
return end_opal_session_error(dev);
399+
if (state > 1) {
400+
end_opal_session_error(dev);
401+
return error;
402+
}
403+
401404
}
402405
state++;
403406
} while (!error);

0 commit comments

Comments
 (0)