Skip to content

Commit

Permalink
[VLAN]: nested VLAN: fix lockdep's recursive locking warning
Browse files Browse the repository at this point in the history
Allow vlans nesting other vlans without lockdep's warnings (max. 2 levels
i.e. parent + child). Thanks to Patrick McHardy for pointing a bug in the
first version of this patch.

Reported-by: Benny Amorsen

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and davem330 committed Jan 11, 2008
1 parent 0d89d79 commit 0fe1e56
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ static const struct header_ops vlan_header_ops = {
static int vlan_dev_init(struct net_device *dev)
{
struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
int subclass = 0;

/* IFF_BROADCAST|IFF_MULTICAST; ??? */
dev->flags = real_dev->flags & ~IFF_UP;
Expand All @@ -349,7 +350,11 @@ static int vlan_dev_init(struct net_device *dev)
dev->hard_start_xmit = vlan_dev_hard_start_xmit;
}

lockdep_set_class(&dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
if (real_dev->priv_flags & IFF_802_1Q_VLAN)
subclass = 1;

lockdep_set_class_and_subclass(&dev->_xmit_lock,
&vlan_netdev_xmit_lock_key, subclass);
return 0;
}

Expand Down

0 comments on commit 0fe1e56

Please sign in to comment.