Commit b1a1fdd7 authored by Weiwen Hu's avatar Weiwen Hu Committed by Keith Busch

nvme: fix nvme_pr_* status code parsing

Fix the parsing if extra status bits (e.g. MORE) is present.

Fixes: 7fb42780 ("nvme: Convert NVMe errors to PR errors")
Signed-off-by: default avatarWeiwen Hu <huweiwen@linux.alibaba.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 7dc3bfcb
...@@ -77,7 +77,7 @@ static int nvme_sc_to_pr_err(int nvme_sc) ...@@ -77,7 +77,7 @@ static int nvme_sc_to_pr_err(int nvme_sc)
if (nvme_is_path_error(nvme_sc)) if (nvme_is_path_error(nvme_sc))
return PR_STS_PATH_FAILED; return PR_STS_PATH_FAILED;
switch (nvme_sc) { switch (nvme_sc & 0x7ff) {
case NVME_SC_SUCCESS: case NVME_SC_SUCCESS:
return PR_STS_SUCCESS; return PR_STS_SUCCESS;
case NVME_SC_RESERVATION_CONFLICT: case NVME_SC_RESERVATION_CONFLICT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment