diff mbox series

[v2,4/5] SUNRPC: Don't override connect timeouts in rpc_clnt_add_xprt()

Message ID 20230819213225.731214-5-trondmy@kernel.org (mailing list archive)
State New, archived
Headers show
Series Improve failover times for pNFS mirroring | expand

Commit Message

Trond Myklebust Aug. 19, 2023, 9:32 p.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

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>
---
 net/sunrpc/clnt.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 9edebfdb5ce1..943dc3897378 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -3071,6 +3071,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,