aboutsummaryrefslogtreecommitdiffstats
path: root/net
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 /net
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 'net')
-rw-r--r--net/core/dev_addr_lists.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index c34ce9f9c976..29c07fef9228 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -439,11 +439,11 @@ int dev_uc_sync(struct net_device *to, struct net_device *from)
439 if (to->addr_len != from->addr_len) 439 if (to->addr_len != from->addr_len)
440 return -EINVAL; 440 return -EINVAL;
441 441
442 netif_addr_lock_bh(to); 442 netif_addr_lock_nested(to);
443 err = __hw_addr_sync(&to->uc, &from->uc, to->addr_len); 443 err = __hw_addr_sync(&to->uc, &from->uc, to->addr_len);
444 if (!err) 444 if (!err)
445 __dev_set_rx_mode(to); 445 __dev_set_rx_mode(to);
446 netif_addr_unlock_bh(to); 446 netif_addr_unlock(to);
447 return err; 447 return err;
448} 448}
449EXPORT_SYMBOL(dev_uc_sync); 449EXPORT_SYMBOL(dev_uc_sync);
@@ -463,7 +463,7 @@ void dev_uc_unsync(struct net_device *to, struct net_device *from)
463 return; 463 return;
464 464
465 netif_addr_lock_bh(from); 465 netif_addr_lock_bh(from);
466 netif_addr_lock(to); 466 netif_addr_lock_nested(to);
467 __hw_addr_unsync(&to->uc, &from->uc, to->addr_len); 467 __hw_addr_unsync(&to->uc, &from->uc, to->addr_len);
468 __dev_set_rx_mode(to); 468 __dev_set_rx_mode(to);
469 netif_addr_unlock(to); 469 netif_addr_unlock(to);
@@ -602,11 +602,11 @@ int dev_mc_sync(struct net_device *to, struct net_device *from)
602 if (to->addr_len != from->addr_len) 602 if (to->addr_len != from->addr_len)
603 return -EINVAL; 603 return -EINVAL;
604 604
605 netif_addr_lock_bh(to); 605 netif_addr_lock_nested(to);
606 err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len); 606 err = __hw_addr_sync(&to->mc, &from->mc, to->addr_len);
607 if (!err) 607 if (!err)
608 __dev_set_rx_mode(to); 608 __dev_set_rx_mode(to);
609 netif_addr_unlock_bh(to); 609 netif_addr_unlock(to);
610 return err; 610 return err;
611} 611}
612EXPORT_SYMBOL(dev_mc_sync); 612EXPORT_SYMBOL(dev_mc_sync);
@@ -626,7 +626,7 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from)
626 return; 626 return;
627 627
628 netif_addr_lock_bh(from); 628 netif_addr_lock_bh(from);
629 netif_addr_lock(to); 629 netif_addr_lock_nested(to);
630 __hw_addr_unsync(&to->mc, &from->mc, to->addr_len); 630 __hw_addr_unsync(&to->mc, &from->mc, to->addr_len);
631 __dev_set_rx_mode(to); 631 __dev_set_rx_mode(to);
632 netif_addr_unlock(to); 632 netif_addr_unlock(to);