Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Weiwen Hu <huweiwen@linux.alibaba.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Mike Christie <michael.christie@oracle.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/3] nvme: fix nvme_pr_* status code parsing
Date: Wed, 29 May 2024 19:18:36 +0000	[thread overview]
Message-ID: <d5cdd059-cf7a-4465-8712-7814fe41f9b8@nvidia.com> (raw)
In-Reply-To: <20240529122300.92377-2-huweiwen@linux.alibaba.com>

On 5/29/24 05:22, Weiwen Hu wrote:
> Fix the parsing if extra status bits (e.g. MORE) is present.
>
> Renamed nvme_sc_to_pr_err to nvme_status_to_pr_err to better match its
> semantic.
>
> Fixes: 7fb42780d06c ("nvme: Convert NVMe errors to PR errors")
> Signed-off-by: Weiwen Hu <huweiwen@linux.alibaba.com>
> ---
>   drivers/nvme/host/pr.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
> index e05571b2a1b0..25e23cdba151 100644
> --- a/drivers/nvme/host/pr.c
> +++ b/drivers/nvme/host/pr.c
> @@ -72,12 +72,12 @@ static int nvme_send_ns_pr_command(struct nvme_ns *ns, struct nvme_command *c,
>   	return nvme_submit_sync_cmd(ns->queue, c, data, data_len);
>   }
>   
> -static int nvme_sc_to_pr_err(int nvme_sc)
> +static int nvme_status_to_pr_err(int nvme_status)

do you really have to make this helper name longer ?
nvme_sc matches the NVME_SC and makes it easy to grep when
looking for symbols and error codes, but if everyone is okay with
this then sure go ahead ...
>   {
> -	if (nvme_is_path_error(nvme_sc))
> +	if (nvme_is_path_error(nvme_status))
>   		return PR_STS_PATH_FAILED;
>   
> -	switch (nvme_sc) {
> +	switch (nvme_status & 0x7ff) {
>   	case NVME_SC_SUCCESS:
>   		return PR_STS_SUCCESS;
>   	case NVME_SC_RESERVATION_CONFLICT:
>

-ck



  reply	other threads:[~2024-05-29 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-29 12:22 [PATCH 0/3] Refactor and fix about NVMe status code Weiwen Hu
2024-05-29 12:22 ` [PATCH 1/3] nvme: fix nvme_pr_* status code parsing Weiwen Hu
2024-05-29 19:18   ` Chaitanya Kulkarni [this message]
2024-05-29 21:41     ` Keith Busch
2024-05-30  6:34       ` Weiwen Hu
2024-05-29 12:22 ` [PATCH 2/3] nvme: fix status magic numbers Weiwen Hu
2024-05-29 12:23 ` [PATCH 3/3] nvme: rename CDR/MORE/DNR to NVME_STATUS_* Weiwen Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5cdd059-cf7a-4465-8712-7814fe41f9b8@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=huweiwen@linux.alibaba.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=michael.christie@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox