summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtsock.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-27 01:01:07 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-11-05 02:46:19 +0300
commit3be232f11a3cc9b0ef0795e39fa11bdb8e422a06 (patch)
tree273fc671f6aa2652a503818ba1b35f69fafcd751 /net/sunrpc/xprtsock.c
parentd896ba8300ebd09e5fc9c43051d9eb36b65e996e (diff)
downloadlinux-3be232f11a3cc9b0ef0795e39fa11bdb8e422a06.tar.xz
SUNRPC: Prevent immediate close+reconnect
If we have already set up the socket and are waiting for it to connect, then don't immediately close and retry. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r--net/sunrpc/xprtsock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 7fb302e202bc..ae48c9c84ee1 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2314,7 +2314,7 @@ static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task)
WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport));
- if (transport->sock != NULL) {
+ if (transport->sock != NULL && !xprt_connecting(xprt)) {
dprintk("RPC: xs_connect delayed xprt %p for %lu "
"seconds\n",
xprt, xprt->reestablish_timeout / HZ);