From: Sagi Grimberg Date: Sun, 28 Nov 2021 13:03:03 +0000 (+0200) Subject: fabrics: fix endless loop in connect-all for NVME_NQN_CURR X-Git-Tag: v1.0-rc0~34^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=02489f250655146e73cf7b54036bde53bcb5bb4b;p=users%2Fsagi%2Flibnvme.git fabrics: fix endless loop in connect-all for NVME_NQN_CURR For a discovery log page entry that indicates the discovery controller that returned it (i.e. itself), we need to set the controller as discovered (because we got the discovery log page by connecting to it). Without this connect-all goes in an endless loop keep connecting and retrieving the log page from the same discovery subsystem port. Fixes: 06a8f001d314 ("tree,fabrics: detect discovery loops") Signed-off-by: Sagi Grimberg --- diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c index 686a5641..9207296b 100644 --- a/src/nvme/fabrics.c +++ b/src/nvme/fabrics.c @@ -657,8 +657,10 @@ nvme_ctrl_t nvmf_connect_disc_entry(nvme_host_t h, } switch (e->subtype) { - case NVME_NQN_DISC: case NVME_NQN_CURR: + nvme_ctrl_set_discovered(c, true); + break; + case NVME_NQN_DISC: if (discover) *discover = true; nvme_ctrl_set_discovery_ctrl(c, true);