diff options
author | Hannes Frederic Sowa <hannes@stressinduktion.org> | 2016-04-08 15:11:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-14 04:37:20 +0200 |
commit | fafc4e1ea1a4c1eb13a30c9426fb799f5efacbc3 (patch) | |
tree | 643293e7032e9c3534e4de33d2a6820e75886f7d /net/sunrpc/svcsock.c | |
parent | net: ethernet: stmmac: GMAC4.xx: Fix TX descriptor preparation (diff) | |
download | linux-fafc4e1ea1a4c1eb13a30c9426fb799f5efacbc3.tar.xz linux-fafc4e1ea1a4c1eb13a30c9426fb799f5efacbc3.zip |
sock: tigthen lockdep checks for sock_owned_by_user
sock_owned_by_user should not be used without socket lock held. It seems
to be a common practice to check .owned before lock reclassification, so
provide a little help to abstract this check away.
Cc: linux-cifs@vger.kernel.org
Cc: linux-bluetooth@vger.kernel.org
Cc: linux-nfs@vger.kernel.org
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 71d6072664d2..dadfec66dbd8 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -85,8 +85,7 @@ static void svc_reclassify_socket(struct socket *sock) { struct sock *sk = sock->sk; - WARN_ON_ONCE(sock_owned_by_user(sk)); - if (sock_owned_by_user(sk)) + if (WARN_ON_ONCE(!sock_allow_reclassification(sk))) return; switch (sk->sk_family) { |