diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-06-24 10:55:47 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-07-13 15:53:44 -0400 |
commit | 069c225b88202c84bdbe18bed9e30e77924fdd0a (patch) | |
tree | 2518e0a9a9a74ff4b5f23e797424c8c27b46e95b /net | |
parent | 104f6351f7dc0036575b4e47765d6d39c757c066 (diff) |
SUNRPC: lock the socket while detaching it
Prevent callbacks from triggering while we're detaching the socket.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svcsock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index dadfec66dbd8..abe2da602fb8 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -1611,9 +1611,12 @@ static void svc_sock_detach(struct svc_xprt *xprt) | |||
1611 | dprintk("svc: svc_sock_detach(%p)\n", svsk); | 1611 | dprintk("svc: svc_sock_detach(%p)\n", svsk); |
1612 | 1612 | ||
1613 | /* put back the old socket callbacks */ | 1613 | /* put back the old socket callbacks */ |
1614 | lock_sock(sk); | ||
1614 | sk->sk_state_change = svsk->sk_ostate; | 1615 | sk->sk_state_change = svsk->sk_ostate; |
1615 | sk->sk_data_ready = svsk->sk_odata; | 1616 | sk->sk_data_ready = svsk->sk_odata; |
1616 | sk->sk_write_space = svsk->sk_owspace; | 1617 | sk->sk_write_space = svsk->sk_owspace; |
1618 | sk->sk_user_data = NULL; | ||
1619 | release_sock(sk); | ||
1617 | 1620 | ||
1618 | wq = sk_sleep(sk); | 1621 | wq = sk_sleep(sk); |
1619 | if (sunrpc_waitqueue_active(wq)) | 1622 | if (sunrpc_waitqueue_active(wq)) |