public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Cc: kbusch@kernel.org, hch@lst.de, linux-nvme@lists.infradead.org,
	sagi@grimberg.me
Subject: Re: [PATCH 3/6] nvmet: check and set the right err location
Date: Wed, 24 Feb 2021 17:31:16 +0100	[thread overview]
Message-ID: <20210224163116.GB10673@lst.de> (raw)
In-Reply-To: <20210216213112.20078-4-chaitanya.kulkarni@wdc.com>

On Tue, Feb 16, 2021 at 01:31:09PM -0800, Chaitanya Kulkarni wrote:
> The function nvmet_execute_admin_connect() doesn't check for the right
> error status value that is return from the nvmet_alloc_ctrl().
> 
> Check for NVME_SC_CONNECT_INVALID_PARAM & NVME_SC_CONNECT_INVALID_HOST
> before we update the error log.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  drivers/nvme/target/fabrics-cmd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
> index 42bd12b8bf00..cf0baa911db2 100644
> --- a/drivers/nvme/target/fabrics-cmd.c
> +++ b/drivers/nvme/target/fabrics-cmd.c
> @@ -191,9 +191,10 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req)
>  	status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req,
>  				  le32_to_cpu(c->kato), &ctrl);
>  	if (status) {
> -		if (status == (NVME_SC_INVALID_FIELD | NVME_SC_DNR))
> +		if (status == (NVME_SC_CONNECT_INVALID_PARAM | NVME_SC_DNR) ||
> +		    status == (NVME_SC_CONNECT_INVALID_HOST | NVME_SC_DNR))
>  			req->error_loc =
> -				offsetof(struct nvme_common_command, opcode);
> +				offsetof(struct nvme_common_command, dptr);

Can we just set req->error_loc inside of nvmet_alloc_ctrl?

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-02-24 16:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 21:31 [PATCH 0/6] nvmet: cleanup and status, error log fix Chaitanya Kulkarni
2021-02-16 21:31 ` [PATCH 1/6] nvmet: remove duplicate status assignment Chaitanya Kulkarni
2021-02-16 21:31 ` [PATCH 2/6] nvmet: set status on actual error condition Chaitanya Kulkarni
2021-02-24 16:30   ` Christoph Hellwig
2021-02-16 21:31 ` [PATCH 3/6] nvmet: check and set the right err location Chaitanya Kulkarni
2021-02-24 16:31   ` Christoph Hellwig [this message]
2021-02-16 21:31 ` [PATCH 4/6] nvmet: remove unnecessary function parameters Chaitanya Kulkarni
2021-02-16 21:31 ` [PATCH 5/6] nvmet: remove unnecessary function parameter Chaitanya Kulkarni
2021-02-16 21:31 ` [PATCH 6/6] nvmet: remove unnecessary function parameters Chaitanya Kulkarni
2021-02-24 16:32 ` [PATCH 0/6] nvmet: cleanup and status, error log fix Christoph Hellwig

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=20210224163116.GB10673@lst.de \
    --to=hch@lst.de \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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