Apparently the nvmf connect code doesn't allow creating
duplicate connections from a host to the same target even
though user specifies option "--duplicate-connect" or "-D".
This patch help fix this issue.
Fixes: 07d6b911e081 ("fabrics: Do not attempt to reconnect to already connected ctrls")
Reported-by: Amit Engel <Amit.Engel@Dell.com>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://lore.kernel.org/r/20240403133438.161916-1-nilay@linux.ibm.com
Signed-off-by: Daniel Wagner <dwagner@suse.de>
};
c = lookup_ctrl(h, &trcfg);
- if (c && nvme_ctrl_get_name(c)) {
+ if (c && nvme_ctrl_get_name(c) && !cfg.duplicate_connect) {
fprintf(stderr, "already connected\n");
errno = EALREADY;
goto out_free;