]> err.no Git - linux-2.6/commitdiff
[PATCH] lockdep: annotate bh_lock_sock()
authorIngo Molnar <mingo@elte.hu>
Mon, 3 Jul 2006 07:25:13 +0000 (00:25 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 3 Jul 2006 22:27:08 +0000 (15:27 -0700)
Teach special (recursive) locking code to the lock validator.  Has no effect
on non-lockdep kernels.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/net/sock.h
net/ipv4/tcp_ipv4.c

index 83805feea8800581a7477b08fc754e3bbb0b44fa..0969fb60d6ea6b5e6396c42600943f8070060f46 100644 (file)
@@ -751,6 +751,9 @@ extern void FASTCALL(release_sock(struct sock *sk));
 
 /* BH context may only use the following locking interface. */
 #define bh_lock_sock(__sk)     spin_lock(&((__sk)->sk_lock.slock))
+#define bh_lock_sock_nested(__sk) \
+                               spin_lock_nested(&((__sk)->sk_lock.slock), \
+                               SINGLE_DEPTH_NESTING)
 #define bh_unlock_sock(__sk)   spin_unlock(&((__sk)->sk_lock.slock))
 
 extern struct sock             *sk_alloc(int family,
index 823717285c6d638f8115e2778a93eabd0fc0f739..5a886e6efbbedfc79ba382d131fa70338b9138d6 100644 (file)
@@ -1090,7 +1090,7 @@ process:
 
        skb->dev = NULL;
 
-       bh_lock_sock(sk);
+       bh_lock_sock_nested(sk);
        ret = 0;
        if (!sock_owned_by_user(sk)) {
 #ifdef CONFIG_NET_DMA