aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeiwen Hu <[email protected]>2024-05-30 14:16:46 +0800
committerKeith Busch <[email protected]>2024-05-31 13:50:59 -0700
commitb1a1fdd7096dd2d67911b07f8118ff113d815db4 (patch)
treec944dbff36b02e9a00fdf144ee2c74ee6643fc01
parent7dc3bfcb4c9cc58970fff6aaa48172cb224d85aa (diff)
nvme: fix nvme_pr_* status code parsing
Fix the parsing if extra status bits (e.g. MORE) is present. Fixes: 7fb42780d06c ("nvme: Convert NVMe errors to PR errors") Signed-off-by: Weiwen Hu <[email protected]> Signed-off-by: Keith Busch <[email protected]>
-rw-r--r--drivers/nvme/host/pr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
index e05571b2a1b0..8fa1ffcdaed4 100644
--- a/drivers/nvme/host/pr.c
+++ b/drivers/nvme/host/pr.c
@@ -77,7 +77,7 @@ static int nvme_sc_to_pr_err(int nvme_sc)
if (nvme_is_path_error(nvme_sc))
return PR_STS_PATH_FAILED;
- switch (nvme_sc) {
+ switch (nvme_sc & 0x7ff) {
case NVME_SC_SUCCESS:
return PR_STS_SUCCESS;
case NVME_SC_RESERVATION_CONFLICT: