diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2008-01-29 21:07:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-03 07:28:33 -0500 |
commit | 21c9d8d73dd1a152c49b4e3176193a099849d4c9 (patch) | |
tree | 115f1f6f1acd454db2ae0c56bc4e575476fa7b1e /drivers/net/bonding | |
parent | 2439f9ebd45349246b0fec7c47e6d0e05b1357c7 (diff) |
bonding: do not acquire rtnl in ARP monitor
The ARP monitor functions currently acquire RTNL when performing
failover operations, but do so incorrectly (out of order). This causes
various warnings from might_sleep.
The ARP monitor isn't supported for any of the bonding modes
that actually require RTNL, so it is safe to not hold RTNL when
failing over in the ARP monitor.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 8a8d5c3de9e3..0942d82f7cbf 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2801,14 +2801,11 @@ void bond_loadbalance_arp_mon(struct work_struct *work) | |||
2801 | } | 2801 | } |
2802 | 2802 | ||
2803 | if (do_failover) { | 2803 | if (do_failover) { |
2804 | rtnl_lock(); | ||
2805 | write_lock_bh(&bond->curr_slave_lock); | 2804 | write_lock_bh(&bond->curr_slave_lock); |
2806 | 2805 | ||
2807 | bond_select_active_slave(bond); | 2806 | bond_select_active_slave(bond); |
2808 | 2807 | ||
2809 | write_unlock_bh(&bond->curr_slave_lock); | 2808 | write_unlock_bh(&bond->curr_slave_lock); |
2810 | rtnl_unlock(); | ||
2811 | |||
2812 | } | 2809 | } |
2813 | 2810 | ||
2814 | re_arm: | 2811 | re_arm: |
@@ -2865,8 +2862,6 @@ void bond_activebackup_arp_mon(struct work_struct *work) | |||
2865 | 2862 | ||
2866 | slave->link = BOND_LINK_UP; | 2863 | slave->link = BOND_LINK_UP; |
2867 | 2864 | ||
2868 | rtnl_lock(); | ||
2869 | |||
2870 | write_lock_bh(&bond->curr_slave_lock); | 2865 | write_lock_bh(&bond->curr_slave_lock); |
2871 | 2866 | ||
2872 | if ((!bond->curr_active_slave) && | 2867 | if ((!bond->curr_active_slave) && |
@@ -2902,7 +2897,6 @@ void bond_activebackup_arp_mon(struct work_struct *work) | |||
2902 | } | 2897 | } |
2903 | 2898 | ||
2904 | write_unlock_bh(&bond->curr_slave_lock); | 2899 | write_unlock_bh(&bond->curr_slave_lock); |
2905 | rtnl_unlock(); | ||
2906 | } | 2900 | } |
2907 | } else { | 2901 | } else { |
2908 | read_lock(&bond->curr_slave_lock); | 2902 | read_lock(&bond->curr_slave_lock); |
@@ -2972,7 +2966,6 @@ void bond_activebackup_arp_mon(struct work_struct *work) | |||
2972 | bond->dev->name, | 2966 | bond->dev->name, |
2973 | slave->dev->name); | 2967 | slave->dev->name); |
2974 | 2968 | ||
2975 | rtnl_lock(); | ||
2976 | write_lock_bh(&bond->curr_slave_lock); | 2969 | write_lock_bh(&bond->curr_slave_lock); |
2977 | 2970 | ||
2978 | bond_select_active_slave(bond); | 2971 | bond_select_active_slave(bond); |
@@ -2980,8 +2973,6 @@ void bond_activebackup_arp_mon(struct work_struct *work) | |||
2980 | 2973 | ||
2981 | write_unlock_bh(&bond->curr_slave_lock); | 2974 | write_unlock_bh(&bond->curr_slave_lock); |
2982 | 2975 | ||
2983 | rtnl_unlock(); | ||
2984 | |||
2985 | bond->current_arp_slave = slave; | 2976 | bond->current_arp_slave = slave; |
2986 | 2977 | ||
2987 | if (slave) { | 2978 | if (slave) { |
@@ -2999,13 +2990,10 @@ void bond_activebackup_arp_mon(struct work_struct *work) | |||
2999 | bond->primary_slave->dev->name); | 2990 | bond->primary_slave->dev->name); |
3000 | 2991 | ||
3001 | /* primary is up so switch to it */ | 2992 | /* primary is up so switch to it */ |
3002 | rtnl_lock(); | ||
3003 | write_lock_bh(&bond->curr_slave_lock); | 2993 | write_lock_bh(&bond->curr_slave_lock); |
3004 | bond_change_active_slave(bond, bond->primary_slave); | 2994 | bond_change_active_slave(bond, bond->primary_slave); |
3005 | write_unlock_bh(&bond->curr_slave_lock); | 2995 | write_unlock_bh(&bond->curr_slave_lock); |
3006 | 2996 | ||
3007 | rtnl_unlock(); | ||
3008 | |||
3009 | slave = bond->primary_slave; | 2997 | slave = bond->primary_slave; |
3010 | slave->jiffies = jiffies; | 2998 | slave->jiffies = jiffies; |
3011 | } else { | 2999 | } else { |