Re: [PATCH] nvmet: drop the redundant auth check in nvmet_parse_io_cmd()

From: Hannes Reinecke

Date: Tue Nov 10 2026 - 08:05:23 EST


On 11/4/26 2:14 PM, shao.mingyin@xxxxxxxxxx wrote:
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

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@xxxxxxxxxx>
---
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@xxxxxxxxxx>

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@xxxxxxx +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