]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: write ctrl_loss_tmo to fabrics device on connect
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 9 Aug 2018 09:25:22 +0000 (11:25 +0200)
committerKeith Busch <keith.busch@intel.com>
Thu, 9 Aug 2018 14:59:04 +0000 (08:59 -0600)
Commit 388c9dbe86be ("fabrics: add ctrl-loss-tmo to connect-all")
introduced the '--ctrl-loss-tmo' option for the connect-all command,
but we forgor to pass down the option to the kernel in connect_ctrl().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 388c9dbe86be ("fabrics: add ctrl-loss-tmo to connect-all")
fixup! fabrics: write ctrl_loss_tmo to fabrics device on connect
Signed-off-by: Keith Busch <keith.busch@intel.com>
fabrics.c

index 8437e323127a4a6842da887ce1f5face49c7e2df..241d8b86d8e6c65c93a950facca2010f801c0cc1 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -621,6 +621,12 @@ static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e)
                p+= len;
        }
 
+       if (cfg.ctrl_loss_tmo) {
+               len = sprintf(p, ",ctrl_loss_tmo=%s", cfg.ctrl_loss_tmo);
+               if (len < 0)
+                       return -EINVAL;
+               p += len;
+       }
 
        switch (e->trtype) {
        case NVMF_TRTYPE_LOOP: /* loop */