diff options
author | Trond Myklebust | 2022-03-16 19:10:43 -0400 |
---|---|---|
committer | Trond Myklebust | 2022-03-22 15:52:55 -0400 |
commit | 89f42494f92f448747bd8a7ab1ae8b5d5520577d (patch) | |
tree | f71b09bc13d49289b34edaec3e3cb8bca5193707 /include/linux/sunrpc/xprtsock.h | |
parent | e47a62df29a0714cc2d5129516a3618337c84554 (diff) |
SUNRPC: Don't call connect() more than once on a TCP socket
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>
Diffstat (limited to 'include/linux/sunrpc/xprtsock.h')
-rw-r--r-- | include/linux/sunrpc/xprtsock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 8c2a712cb242..689062afdd61 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h @@ -89,5 +89,6 @@ 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 /* _LINUX_SUNRPC_XPRTSOCK_H */ |