]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: write keep-alive-timeout to fabrics device on connect
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 9 Aug 2018 09:25:23 +0000 (11:25 +0200)
committerKeith Busch <keith.busch@intel.com>
Thu, 9 Aug 2018 14:59:08 +0000 (08:59 -0600)
Commit 7099227b07a8 ("fabrics: add option to supply keep-alive-timeout
for connect-all") introduced a keep-alive-timeout option for
connect-all but forgot to write it down to the kernel's fabrics
device in connect_ctrl().

Pass down the keep-alove-timeouts if we're connecting to a non
discovery controller.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 7099227b07a8 ("fabrics: add option to supply keep-alive-timeout for connect-all")
Signed-off-by: Keith Busch <keith.busch@intel.com>
fabrics.c

index 241d8b86d8e6c65c93a950facca2010f801c0cc1..28e97c5aea3b0b0b4590acd9700481fb769292bd 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -628,6 +628,13 @@ static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e)
                p += len;
        }
 
+       if (cfg.keep_alive_tmo && !discover) {
+               len = sprintf(p, ",keep_alive_tmo=%s", cfg.keep_alive_tmo);
+               if (len < 0)
+                       return -EINVAL;
+               p += len;
+       }
+
        switch (e->trtype) {
        case NVMF_TRTYPE_LOOP: /* loop */
                len = sprintf(p, ",transport=loop");