Meena Shanmugam 975a0f14d5 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>
2022-05-25 09:14:34 +02:00
..
2022-03-11 11:22:39 +01:00
2022-04-20 09:19:40 +02:00
2019-09-26 08:56:17 +02:00
2022-05-18 09:47:28 +02:00
2019-12-04 22:30:54 +01:00
2021-06-18 09:59:00 +02:00