[PATCH v2 4/9] nvme-fabrics: remove dead hostnqn already-assigned check
Guixin Liu
kanie at linux.alibaba.com
Thu Nov 5 18:27:31 PST 2026
The opts->host check in the NVMF_OPT_HOSTNQN handler can never fire:
options are parsed into a freshly allocated struct, and opts->host is
only assigned after the parsing loop completes. A duplicate hostnqn
option is already silently overridden by the strscpy() into the local
buffer. Remove the dead check.
Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
---
drivers/nvme/host/fabrics.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 3d7ad86c1955..c262538523fb 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -872,12 +872,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
opts->fast_io_fail_tmo = token;
break;
case NVMF_OPT_HOSTNQN:
- if (opts->host) {
- pr_err("hostnqn already user-assigned: %s\n",
- opts->host->nqn);
- ret = -EADDRINUSE;
- goto out;
- }
p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
--
2.43.7
More information about the Linux-nvme
mailing list