summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMeena Shanmugam <meenashanmugam@google.com>2022-05-18 21:40:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-25 10:14:34 +0300
commit975a0f14d5cd29fe4b33190b5afcfa9f244b769d (patch)
treebe03a6d6c3768766a882e2c67f69e7a4e84831a2 /include
parentaa4d71edd60941bc05d2a0efe1e98a67c5dd59b7 (diff)
downloadlinux-975a0f14d5cd29fe4b33190b5afcfa9f244b769d.tar.xz
SUNRPC: Don't call connect() more than once on a TCP socket
From: Trond Myklebust <trond.myklebust@hammerspace.com> commit 89f42494f92f448747bd8a7ab1ae8b5d5520577d upstream. Avoid socket state races due to repeated calls to ->connect() using the same socket. If connect() returns 0 due to the connection having completed, but we are in fact in a closing state, then we may leave the XPRT_CONNECTING flag set on the transport. Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Fixes: 3be232f11a3c ("SUNRPC: Prevent immediate close+reconnect") Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> [meenashanmugam: Fix merge conflict in xs_tcp_setup_socket] Signed-off-by: Meena Shanmugam <meenashanmugam@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/xprtsock.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h
index a940de03808d..46deca97e806 100644
--- a/include/linux/sunrpc/xprtsock.h
+++ b/include/linux/sunrpc/xprtsock.h
@@ -90,6 +90,7 @@ struct sock_xprt {
#define XPRT_SOCK_WAKE_WRITE (5)
#define XPRT_SOCK_WAKE_PENDING (6)
#define XPRT_SOCK_WAKE_DISCONNECT (7)
+#define XPRT_SOCK_CONNECT_SENT (8)
#endif /* __KERNEL__ */