aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-01-09 01:36:54 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-09 15:46:58 -0500
commit2429f7ac2ef429378536d87fcbbf6f424aa5b47f (patch)
tree15e0fd0c42f6e10ede9f1cf84553c2a01e593d81 /include/linux/netdevice.h
parentab16ebf375f0513d6b0f5193de84186a3fc0c33b (diff)
net: introduce netif_addr_lock_nested() and call if when appropriate
dev_uc_sync() and dev_mc_sync() are acquiring netif_addr_lock for destination device of synchronization. Since netif_addr_lock is already held at the time for source device, this triggers lockdep deadlock warning. There's no way this deadlock can happen so use spin_lock_nested() to silence the warning. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a1d109590da4..d0522bb2d4a0 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2450,6 +2450,11 @@ static inline void netif_addr_lock(struct net_device *dev)
2450 spin_lock(&dev->addr_list_lock); 2450 spin_lock(&dev->addr_list_lock);
2451} 2451}
2452 2452
2453static inline void netif_addr_lock_nested(struct net_device *dev)
2454{
2455 spin_lock_nested(&dev->addr_list_lock, SINGLE_DEPTH_NESTING);
2456}
2457
2453static inline void netif_addr_lock_bh(struct net_device *dev) 2458static inline void netif_addr_lock_bh(struct net_device *dev)
2454{ 2459{
2455 spin_lock_bh(&dev->addr_list_lock); 2460 spin_lock_bh(&dev->addr_list_lock);