mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
SUNRPC: Fix a race with XPRT_CONNECTING
[ Upstream commit cf76785d30 ]
Ensure that we clear XPRT_CONNECTING before releasing the XPRT_LOCK so that
we don't have races between the (asynchronous) socket setup code and
tasks in xprt_connect().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4f784484bd
commit
233ba13db6
@@ -2244,8 +2244,8 @@ static void xs_udp_setup_socket(struct work_struct *work)
|
||||
trace_rpc_socket_connect(xprt, sock, 0);
|
||||
status = 0;
|
||||
out:
|
||||
xprt_unlock_connect(xprt, transport);
|
||||
xprt_clear_connecting(xprt);
|
||||
xprt_unlock_connect(xprt, transport);
|
||||
xprt_wake_pending_tasks(xprt, status);
|
||||
}
|
||||
|
||||
@@ -2480,8 +2480,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
|
||||
}
|
||||
status = -EAGAIN;
|
||||
out:
|
||||
xprt_unlock_connect(xprt, transport);
|
||||
xprt_clear_connecting(xprt);
|
||||
xprt_unlock_connect(xprt, transport);
|
||||
xprt_wake_pending_tasks(xprt, status);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user