Skip to contentSkip to conversation

fabrics connect-all fixes

PATCH New Johannes Thumshirn 2 participants 4 messages Aug 9, 2018 NVMe

lore
Share & tools
lore
#0 lore raw

v2 cover fabrics connect-all fixes

Two small fixes for fabrics commits of mine, which introduced options but forgot to pass them down to the kernel.

Cahnges to v1:
* Add missing space between variable and '+' (Chaitanya)

Johannes Thumshirn (2):
fabrics: write ctrl_loss_tmo to fabrics device on connect
fabrics: write keep-alive-timeout to fabrics device on connect

 fabrics.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Signature · 1 line
2.16.4
#1 lore raw

PATCH v2 1/2 fabrics: write ctrl_loss_tmo to fabrics device on connect

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 at suse.de>
Fixes 388c9dbe86be ("fabrics: add ctrl-loss-tmo to connect-all")

fixup! fabrics: write ctrl_loss_tmo to fabrics device on connect

---
 fabrics.c | 6 ++++++
 1 file changed, 6 insertions(+)
fabrics.c +6 -0
index 8437e323127a..241d8b86d8e6 100644
@@ -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 */
Signature · 1 line
2.16.4
#2 lore raw

PATCH v2 2/2 fabrics: write keep-alive-timeout to fabrics device on connect

In reply to Johannes Thumshirn

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 at suse.de>
Fixes 7099227b07a8 ("fabrics: add option to supply keep-alive-timeout for connect-all")
---
 fabrics.c | 7 +++++++
 1 file changed, 7 insertions(+)
fabrics.c +7 -0
index 241d8b86d8e6..28e97c5aea3b 100644
@@ -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");
Signature · 1 line
2.16.4
#3 lore raw

v2 cover fabrics connect-all fixes

In reply to Johannes Thumshirn
Quoted 2 lines · Johannes Thumshirn

Two small fixes for fabrics commits of mine, which introduced options but forgot to pass them down to the kernel.

Thanks, series applied.