SUNRPC: Don't override connect timeouts in rpc_clnt_add_xprt()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 19 Aug 2023 21:32:24 +0000 (17:32 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 24 Aug 2023 17:24:15 +0000 (13:24 -0400)
If the caller specifies the connect timeouts in the arguments to
rpc_clnt_add_xprt(), then we shouldn't override them.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/clnt.c

index 06df08b..8d75290 100644 (file)
@@ -3072,6 +3072,11 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
        }
        xprt->resvport = resvport;
        xprt->reuseport = reuseport;
+
+       if (xprtargs->connect_timeout)
+               connect_timeout = xprtargs->connect_timeout;
+       if (xprtargs->reconnect_timeout)
+               reconnect_timeout = xprtargs->reconnect_timeout;
        if (xprt->ops->set_connect_timeout != NULL)
                xprt->ops->set_connect_timeout(xprt,
                                connect_timeout,