From 68bc86922296c817d385fd21d02862148b9bbb9d Mon Sep 17 00:00:00 2001 From: Sagi Grimberg Date: Wed, 19 Aug 2020 20:13:20 -0700 Subject: [PATCH] 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.") Signed-off-by: Sagi Grimberg --- fabrics.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fabrics.c b/fabrics.c index c93b752f..f8a055b7 100644 --- 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; -- 2.50.1