diff options
| author | Eric Dumazet <edumazet@google.com> | 2016-04-25 09:34:09 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-04-25 11:49:53 -0400 |
| commit | 5e91f6ce4c584d231763437a3ea3aded8e672363 (patch) | |
| tree | 7d6d2b5bf826bdf6ca752bc8fd8991b410ea4694 | |
| parent | 15cfd40771e18a4e9b788c64c9db2606f958b93d (diff) | |
sock: relax WARN_ON() in sock_owned_by_user()
Valdis reported tons of stack dumps caused by WARN_ON() in
sock_owned_by_user()
This test needs to be relaxed if/when lockdep disables itself.
Note that other lockdep_sock_is_held() callers are all from
rcu_dereference_protected() sections which already are disabled
if/when lockdep has been disabled.
Fixes: fafc4e1ea1a4 ("sock: tigthen lockdep checks for sock_owned_by_user")
Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/net/sock.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 52448baf19d7..2fdb87f176cf 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1409,7 +1409,7 @@ static inline void unlock_sock_fast(struct sock *sk, bool slow) | |||
| 1409 | static inline bool sock_owned_by_user(const struct sock *sk) | 1409 | static inline bool sock_owned_by_user(const struct sock *sk) |
| 1410 | { | 1410 | { |
| 1411 | #ifdef CONFIG_LOCKDEP | 1411 | #ifdef CONFIG_LOCKDEP |
| 1412 | WARN_ON(!lockdep_sock_is_held(sk)); | 1412 | WARN_ON_ONCE(!lockdep_sock_is_held(sk) && debug_locks); |
| 1413 | #endif | 1413 | #endif |
| 1414 | return sk->sk_lock.owned; | 1414 | return sk->sk_lock.owned; |
| 1415 | } | 1415 | } |
