Commit b616b09a authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

vlan: rcu annotations

(struct net_device)->vlgrp is rcu protected :

add __rcu annotation and proper rcu primitives.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5202e173
...@@ -944,7 +944,7 @@ struct net_device { ...@@ -944,7 +944,7 @@ struct net_device {
/* Protocol specific pointers */ /* Protocol specific pointers */
#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
struct vlan_group *vlgrp; /* VLAN group */ struct vlan_group __rcu *vlgrp; /* VLAN group */
#endif #endif
#ifdef CONFIG_NET_DSA #ifdef CONFIG_NET_DSA
void *dsa_ptr; /* dsa specific data */ void *dsa_ptr; /* dsa specific data */
......
...@@ -112,7 +112,7 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) ...@@ -112,7 +112,7 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
ASSERT_RTNL(); ASSERT_RTNL();
grp = real_dev->vlgrp; grp = rtnl_dereference(real_dev->vlgrp);
BUG_ON(!grp); BUG_ON(!grp);
/* Take it out of our own structures, but be sure to interlock with /* Take it out of our own structures, but be sure to interlock with
...@@ -177,7 +177,7 @@ int register_vlan_dev(struct net_device *dev) ...@@ -177,7 +177,7 @@ int register_vlan_dev(struct net_device *dev)
struct vlan_group *grp, *ngrp = NULL; struct vlan_group *grp, *ngrp = NULL;
int err; int err;
grp = real_dev->vlgrp; grp = rtnl_dereference(real_dev->vlgrp);
if (!grp) { if (!grp) {
ngrp = grp = vlan_group_alloc(real_dev); ngrp = grp = vlan_group_alloc(real_dev);
if (!grp) if (!grp)
...@@ -385,7 +385,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, ...@@ -385,7 +385,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0); dev->netdev_ops->ndo_vlan_rx_add_vid(dev, 0);
} }
grp = dev->vlgrp; grp = rtnl_dereference(dev->vlgrp);
if (!grp) if (!grp)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment