]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: Only disconnect discovery controllers during 'connect-all'
authorHannes Reinecke <hare@suse.de>
Fri, 14 Jan 2022 13:16:22 +0000 (14:16 +0100)
committerHannes Reinecke <hare@suse.de>
Fri, 14 Jan 2022 13:16:22 +0000 (14:16 +0100)
When calling 'connect-all' the 'persistent' argument only applies to
discovery controllers; normal I/O controllers should stay connected,
as this was kinda the point...

Signed-off-by: Hannes Reinecke <hare@suse.de>
fabrics.c

index 2252aa6fc1f6859e3917676a3ce56a6ecb3b3ff0..55cc247c0e19596273b2d3301c9fb25689d34bd3 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -302,7 +302,8 @@ static int __discover(nvme_ctrl_t c, const struct nvme_fabrics_config *defcfg,
                                        __discover(child, defcfg, raw,
                                                   persistent,
                                                   true, flags);
-                               if (!persistent) {
+                               if (e->subtype != NVME_NQN_NVME &&
+                                   !persistent) {
                                        nvme_disconnect_ctrl(child);
                                        nvme_free_ctrl(child);
                                }