From fd8ecb054ce53acae504e54666bec6c9976a82dd Mon Sep 17 00:00:00 2001 From: Nilay Shroff Date: Wed, 3 Apr 2024 19:04:16 +0530 Subject: [PATCH] fabrics : allow host to create duplicate connections to target 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 Signed-off-by: Nilay Shroff Link: https://lore.kernel.org/r/20240403133438.161916-1-nilay@linux.ibm.com Signed-off-by: Daniel Wagner --- fabrics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabrics.c b/fabrics.c index 14682907..0f55c617 100644 --- a/fabrics.c +++ b/fabrics.c @@ -1001,7 +1001,7 @@ int nvmf_connect(const char *desc, int argc, char **argv) }; 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; -- 2.50.1