Commit cf76785d authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Fix a race with XPRT_CONNECTING

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: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 0445f92c
...@@ -2090,8 +2090,8 @@ static void xs_udp_setup_socket(struct work_struct *work) ...@@ -2090,8 +2090,8 @@ static void xs_udp_setup_socket(struct work_struct *work)
trace_rpc_socket_connect(xprt, sock, 0); trace_rpc_socket_connect(xprt, sock, 0);
status = 0; status = 0;
out: out:
xprt_unlock_connect(xprt, transport);
xprt_clear_connecting(xprt); xprt_clear_connecting(xprt);
xprt_unlock_connect(xprt, transport);
xprt_wake_pending_tasks(xprt, status); xprt_wake_pending_tasks(xprt, status);
} }
...@@ -2327,8 +2327,8 @@ static void xs_tcp_setup_socket(struct work_struct *work) ...@@ -2327,8 +2327,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
} }
status = -EAGAIN; status = -EAGAIN;
out: out:
xprt_unlock_connect(xprt, transport);
xprt_clear_connecting(xprt); xprt_clear_connecting(xprt);
xprt_unlock_connect(xprt, transport);
xprt_wake_pending_tasks(xprt, status); xprt_wake_pending_tasks(xprt, status);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment