Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2ecba71717c4f60671175fd26083c35a4b9ad58
Commit:     c2ecba71717c4f60671175fd26083c35a4b9ad58
Parent:     5e7d7fa57323dfb48fb09464cf4542daa7ce8a72
Author:     Pavel Emelianov <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 17 12:45:31 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Apr 17 13:13:31 2007 -0700

    [NET]: Set a separate lockdep class for neighbour table's proxy_queue
    
    Otherwise the following calltrace will lead to a wrong
    lockdep warning:
    
      neigh_proxy_process()
        `- lock(neigh_table->proxy_queue.lock);
      arp_redo /* via tbl->proxy_redo */
      arp_process
      neigh_event_ns
      neigh_update
      skb_queue_purge
        `- lock(neighbor->arp_queue.lock);
    
    This is not a deadlock actually, as neighbor table's proxy_queue
    and the neighbor's arp_queue are different queues.
    
    Lockdep thinks there is a deadlock as both queues are initialized
    with skb_queue_head_init() and thus have a common class.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/skbuff.h |    7 +++++++
 net/core/neighbour.c   |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0e86b60..5992f65 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -619,6 +619,13 @@ static inline void skb_queue_head_init(struct sk_buff_head 
*list)
        list->qlen = 0;
 }
 
+static inline void skb_queue_head_init_class(struct sk_buff_head *list,
+               struct lock_class_key *class)
+{
+       skb_queue_head_init(list);
+       lockdep_set_class(&list->lock, class);
+}
+
 /*
  *     Insert an sk_buff at the start of a list.
  *
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index cfc6001..841e3f3 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1331,6 +1331,8 @@ void neigh_parms_destroy(struct neigh_parms *parms)
        kfree(parms);
 }
 
+static struct lock_class_key neigh_table_proxy_queue_class;
+
 void neigh_table_init_no_netlink(struct neigh_table *tbl)
 {
        unsigned long now = jiffies;
@@ -1379,7 +1381,8 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
        init_timer(&tbl->proxy_timer);
        tbl->proxy_timer.data     = (unsigned long)tbl;
        tbl->proxy_timer.function = neigh_proxy_process;
-       skb_queue_head_init(&tbl->proxy_queue);
+       skb_queue_head_init_class(&tbl->proxy_queue,
+                       &neigh_table_proxy_queue_class);
 
        tbl->last_flush = now;
        tbl->last_rand  = now + tbl->parms.reachable_time * 20;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to