Skip to contentSkip to conversation

fabrics: fix passing ctrl_loss_tmo=0 by default

PATCH In review Sagi Grimberg 2 participants 2 messages Aug 20, 2020 NVMe

lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 fabrics: fix passing ctrl_loss_tmo=0 by default

cfg.ctrl_loss_tmo will be cleared to zero even if it wasn't set at all, we must not pass ctrl_loss_tmo in the connection string.

This fixes a regression caused by allowing ctrl_loss_tmo to be zero at all, by setting it to be a sane default (which currently matches the kernel default).

Fixes a6105a30a39a ("nvme-cli/fabrics: Add tos param to connect cmd")
Fixes 4b607779af71 ("Allow 0 value of ctrl_loss_tmo.")
---
 fabrics.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fabrics.c +4 -1
index c93b752ff142..f8a055b7d9ba 100644
@@ -54,6 +54,9 @@
 
 #define NVMF_HOSTID_SIZE	36
 
+/* default to 600 seconds of reconnect attempts before giving up */
+#define NVMF_DEF_CTRL_LOSS_TMO		600
+
 const char *conarg_nqn = "nqn";
 const char *conarg_transport = "transport";
 const char *conarg_traddr = "traddr";
@@ -85,7 +88,7 @@ static struct config {
 	bool persistent;
 	bool quiet;
 	bool matching_only;
-} cfg = { NULL };
+} cfg = { .ctrl_loss_tmo = NVMF_DEF_CTRL_LOSS_TMO };
 
 struct connect_args {
 	char *subsysnqn;
Signature · 7 lines
2.25.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme