All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: sagi@grimberg.me, linux-nvme@lists.infradead.org,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	hch@lst.de
Subject: Re: [V3 1/4] nvmet: set right status on error in id-ns handler
Date: Wed, 13 Jan 2021 19:34:25 +0100	[thread overview]
Message-ID: <20210113183425.GA19474@lst.de> (raw)
In-Reply-To: <20210112214801.GA1505636@dhcp-10-100-145-180.wdc.com>

On Tue, Jan 12, 2021 at 01:48:01PM -0800, Keith Busch wrote:
> On Tue, Jan 12, 2021 at 01:14:07PM -0800, Chaitanya Kulkarni wrote:
> > @@ -541,7 +543,9 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
> >  		id->nsattr |= (1 << 0);
> >  	nvmet_put_namespace(ns);
> >  done:
> > -	status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));
> > +	if (nvmet_copy_to_sgl(req, 0, id, sizeof(*id)) && !status)
> > +		status = NVME_SC_SGL_INVALID_DATA | NVME_SC_DNR;
> 
> If the status is already in error, you don't need to copy out the
> blank struct, right? Shouldn't this be like:
> 
> 	if (!status)
> 		status = nvmet_copy_to_sgl(req, 0, id, sizeof(*id));

Yes.

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

  reply	other threads:[~2021-01-13 18:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 21:14 [V3 0/4] nvmet: admin-cmd related cleanups and a fix Chaitanya Kulkarni
2021-01-12 21:14 ` [V3 1/4] nvmet: set right status on error in id-ns handler Chaitanya Kulkarni
2021-01-12 21:48   ` Keith Busch
2021-01-13 18:34     ` Christoph Hellwig [this message]
2021-01-12 21:14 ` [V3 2/4] nvmet: remove extra variable in smart log nsid Chaitanya Kulkarni
2021-01-13 22:04   ` Sagi Grimberg
2021-01-12 21:14 ` [V3 3/4] nvmet: remove extra variable in id-desclist Chaitanya Kulkarni
2021-01-13 22:06   ` Sagi Grimberg
2021-01-12 21:14 ` [V3 4/4] nvmet: remove extra variable in identify ns Chaitanya Kulkarni
2021-01-13 22:06   ` Sagi Grimberg

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=20210113183425.GA19474@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.