]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: fix passing ctrl_loss_tmo=0 by default
authorSagi Grimberg <sagi@grimberg.me>
Thu, 20 Aug 2020 03:13:20 +0000 (20:13 -0700)
committerKeith Busch <kbusch@kernel.org>
Thu, 20 Aug 2020 20:11:44 +0000 (13:11 -0700)
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.")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
fabrics.c

index c93b752ff1424e4c41ff71e5d03d50f0b6cd8be4..f8a055b7d9ba041c377bfcd5cf9807be31f9790a 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -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;