Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] nvme: fix nvme_pr_* status code parsing
@ 2024-05-30  6:16 Weiwen Hu
  2024-05-31  8:16 ` Christoph Hellwig
  2024-05-31 20:52 ` Keith Busch
  0 siblings, 2 replies; 5+ messages in thread
From: Weiwen Hu @ 2024-05-30  6:16 UTC (permalink / raw)
  To: linux-nvme, Chaitanya Kulkarni, Keith Busch
  Cc: Mike Christie, Christoph Hellwig, Weiwen Hu

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 <huweiwen@linux.alibaba.com>
---
previous version of this is sent as
https://lore.kernel.org/linux-nvme/20240529122300.92377-2-huweiwen@linux.alibaba.com/

 drivers/nvme/host/pr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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:
-- 
2.45.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-31 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  6:16 [PATCH v2] nvme: fix nvme_pr_* status code parsing Weiwen Hu
2024-05-31  8:16 ` Christoph Hellwig
2024-05-31  8:50   ` Weiwen Hu
2024-05-31 20:53   ` Keith Busch
2024-05-31 20:52 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox