* [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* Re: [PATCH v2] nvme: fix nvme_pr_* status code parsing
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
1 sibling, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-05-31 8:16 UTC (permalink / raw)
To: Weiwen Hu
Cc: linux-nvme, Chaitanya Kulkarni, Keith Busch, Mike Christie,
Christoph Hellwig
On Thu, May 30, 2024 at 02:16:46PM +0800, Weiwen Hu wrote:
> + switch (nvme_sc & 0x7ff) {
Can you use the opportunity to add a NVME_SC_MASK symbolic
name for the magic 0x7ff? We should have done this earlier
with already 5 occurrences, but better now than never.
Otherwise this looks good to me.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] nvme: fix nvme_pr_* status code parsing
2024-05-31 8:16 ` Christoph Hellwig
@ 2024-05-31 8:50 ` Weiwen Hu
2024-05-31 20:53 ` Keith Busch
1 sibling, 0 replies; 5+ messages in thread
From: Weiwen Hu @ 2024-05-31 8:50 UTC (permalink / raw)
To: Christoph Hellwig
Cc: linux-nvme, Chaitanya Kulkarni, Keith Busch, Mike Christie
On Fri, May 31, 2024 at 10:16:50AM +0200, Christoph Hellwig wrote:
> On Thu, May 30, 2024 at 02:16:46PM +0800, Weiwen Hu wrote:
> > + switch (nvme_sc & 0x7ff) {
>
> Can you use the opportunity to add a NVME_SC_MASK symbolic
> name for the magic 0x7ff? We should have done this earlier
> with already 5 occurrences, but better now than never.
I've already sent this in the previous patch:
[PATCH 2/3] nvme: fix status magic numbers
I chose the name NVME_SCT_SC_MASK to match the NVMe spec better
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] nvme: fix nvme_pr_* status code parsing
2024-05-31 8:16 ` Christoph Hellwig
2024-05-31 8:50 ` Weiwen Hu
@ 2024-05-31 20:53 ` Keith Busch
1 sibling, 0 replies; 5+ messages in thread
From: Keith Busch @ 2024-05-31 20:53 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Weiwen Hu, linux-nvme, Chaitanya Kulkarni, Mike Christie
On Fri, May 31, 2024 at 10:16:50AM +0200, Christoph Hellwig wrote:
> On Thu, May 30, 2024 at 02:16:46PM +0800, Weiwen Hu wrote:
> > + switch (nvme_sc & 0x7ff) {
>
> Can you use the opportunity to add a NVME_SC_MASK symbolic
> name for the magic 0x7ff? We should have done this earlier
> with already 5 occurrences, but better now than never.
>
> Otherwise this looks good to me.
Yeah, I suggested sending the minimal patch first just for the
backport-ability.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] nvme: fix nvme_pr_* status code parsing
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 20:52 ` Keith Busch
1 sibling, 0 replies; 5+ messages in thread
From: Keith Busch @ 2024-05-31 20:52 UTC (permalink / raw)
To: Weiwen Hu
Cc: linux-nvme, Chaitanya Kulkarni, Mike Christie, Christoph Hellwig
On Thu, May 30, 2024 at 02:16:46PM +0800, Weiwen Hu wrote:
> 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>
Thanks, applied to nvme-6.10.
^ permalink raw reply [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