Commit 069c225b authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

SUNRPC: lock the socket while detaching it

Prevent callbacks from triggering while we're detaching the socket.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 104f6351
...@@ -1611,9 +1611,12 @@ static void svc_sock_detach(struct svc_xprt *xprt) ...@@ -1611,9 +1611,12 @@ static void svc_sock_detach(struct svc_xprt *xprt)
dprintk("svc: svc_sock_detach(%p)\n", svsk); dprintk("svc: svc_sock_detach(%p)\n", svsk);
/* put back the old socket callbacks */ /* put back the old socket callbacks */
lock_sock(sk);
sk->sk_state_change = svsk->sk_ostate; sk->sk_state_change = svsk->sk_ostate;
sk->sk_data_ready = svsk->sk_odata; sk->sk_data_ready = svsk->sk_odata;
sk->sk_write_space = svsk->sk_owspace; sk->sk_write_space = svsk->sk_owspace;
sk->sk_user_data = NULL;
release_sock(sk);
wq = sk_sleep(sk); wq = sk_sleep(sk);
if (sunrpc_waitqueue_active(wq)) if (sunrpc_waitqueue_active(wq))
......
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