* [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
@ 2026-11-04 13:14 shao.mingyin
2026-11-05 7:47 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: shao.mingyin @ 2026-11-04 13:14 UTC (permalink / raw)
To: hch, sagi, kch, linux-nvme; +Cc: linux-kernel
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
2026-11-04 13:14 [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd() shao.mingyin
@ 2026-11-05 7:47 ` Christoph Hellwig
2026-11-05 15:11 ` Keith Busch
2026-11-10 12:56 ` Hannes Reinecke
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2026-11-05 7:47 UTC (permalink / raw)
To: shao.mingyin; +Cc: hch, sagi, kch, linux-nvme, linux-kernel
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
2026-11-04 13:14 [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd() shao.mingyin
2026-11-05 7:47 ` Christoph Hellwig
@ 2026-11-05 15:11 ` Keith Busch
2026-11-10 12:56 ` Hannes Reinecke
2 siblings, 0 replies; 4+ messages in thread
From: Keith Busch @ 2026-11-05 15:11 UTC (permalink / raw)
To: hch, sagi, kch, linux-nvme, shao.mingyin; +Cc: linux-kernel
On Wed, 04 Nov 2026 21:14:46 +0800, shao.mingyin@zte.com.cn wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
commit: f96d1722e5861375c47c315117d900ef103ab331
Best regards,
--
Keith Busch <kbusch@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()
2026-11-04 13:14 [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd() shao.mingyin
2026-11-05 7:47 ` Christoph Hellwig
2026-11-05 15:11 ` Keith Busch
@ 2026-11-10 12:56 ` Hannes Reinecke
2 siblings, 0 replies; 4+ messages in thread
From: Hannes Reinecke @ 2026-11-10 12:56 UTC (permalink / raw)
To: shao.mingyin, hch, sagi, kch, linux-nvme; +Cc: linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-10 12:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 13:14 [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd() shao.mingyin
2026-11-05 7:47 ` Christoph Hellwig
2026-11-05 15:11 ` Keith Busch
2026-11-10 12:56 ` Hannes Reinecke
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®