From: Hannes Reinecke <hare@suse.de>
To: shao.mingyin@zte.com.cn, hch@lst.de, sagi@grimberg.me,
kch@nvidia.com, linux-nvme@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
Date: Tue, 10 Nov 2026 13:56:34 +0100 [thread overview]
Message-ID: <b0671c91-4fcc-4bea-a2c7-1029a54a53ad@suse.de> (raw)
In-Reply-To: <20261104211446891tN1QRJiKV3CLPQqfb7gJu@zte.com.cn>
On 11/4/26 2:14 PM, shao.mingyin@zte.com.cn wrote:
> From: Shao Mingyin <shao.mingyin@zte.com.cn>
>
> nvmet_parse_io_cmd() calls nvmet_check_auth_status() and then
> nvmet_check_ctrl_status(), which performs the same check again. The
> first call cannot fail either: this path only handles commands from I/O
> queues, and nvmet_check_auth_status() returns true unconditionally for
> qid > 0. Drop the duplicate.
>
> No functional change.
>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index a8171b88035c..12b82bb7e412 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -1120,9 +1120,6 @@ static u16 nvmet_parse_io_cmd(struct nvmet_req *req)
> if (nvme_is_fabrics(cmd))
> return nvmet_parse_fabrics_io_cmd(req);
>
> - if (unlikely(!nvmet_check_auth_status(req)))
> - return NVME_SC_AUTH_REQUIRED | NVME_STATUS_DNR;
> -
> ret = nvmet_check_ctrl_status(req);
> if (unlikely(ret))
> return ret;
>
If you insist ...
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
prev parent reply other threads:[~2026-11-10 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 13:14 shao.mingyin
2026-11-05 7:47 ` Christoph Hellwig
2026-11-05 15:11 ` Keith Busch
2026-11-10 12:56 ` Hannes Reinecke [this message]
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=b0671c91-4fcc-4bea-a2c7-1029a54a53ad@suse.de \
--to=hare@suse.de \
--cc=hch@lst.de \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=shao.mingyin@zte.com.cn \
/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
all inboxes | Powered by JetHome®