[patch] lockdep annotate vlan net device as being a special class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-06-15 at 16:40 +0200, [email protected] wrote:
> Hi,
> 
> Assigning an inet address to a vlanized interface triggered the following BUG
> from the lock validator (kernel is 2.6.17-rc6-mm2):

ok below is a real working (cross my fingers) patch against the current
-mm tree:

vlan network devices have devices nesting below it, and are a special
"super class" of normal network devices; split their locks off into a
separate class since they always nest.

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
 net/8021q/vlan.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: linux-2.6.17-lockdep/net/8021q/vlan.c
===================================================================
--- linux-2.6.17-lockdep.orig/net/8021q/vlan.c
+++ linux-2.6.17-lockdep/net/8021q/vlan.c
@@ -364,6 +364,14 @@ static void vlan_transfer_operstate(cons
 	}
 }
 
+/*
+ * vlan network devices have devices nesting below it, and are a special
+ * "super class" of normal network devices; split their locks off into a
+ * separate class since they always nest.
+ */
+static struct lock_class_key vlan_netdev_xmit_lock_key;
+
+
 /*  Attach a VLAN device to a mac address (ie Ethernet Card).
  *  Returns the device that was created, or NULL if there was
  *  an error of some kind.
@@ -460,6 +468,8 @@ static struct net_device *register_vlan_
 		    
 	new_dev = alloc_netdev(sizeof(struct vlan_dev_info), name,
 			       vlan_setup);
+
+	lockdep_set_class(&new_dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
 	if (new_dev == NULL)
 		goto out_unlock;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux