File 0021-fabrics-write-ctrl_loss_tmo-to-fabrics-device-on-con.patch of Package nvme-cli.11415

From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Thu, 9 Aug 2018 11:25:22 +0200
Subject: [PATCH] fabrics: write ctrl_loss_tmo to fabrics device on connect

Git-commit: 2db885e79033032b61baad626db066387c490148
References: bsc#1090568

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 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fabrics.c b/fabrics.c
index e48b834..e389821 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -628,6 +628,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 */
-- 
2.13.7

openSUSE Build Service is sponsored by