aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJay Vosburgh <fubar@us.ibm.com>2008-05-18 00:10:07 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 06:34:17 -0400
commit5ce0da8f0386b62345312ec8fed31303732f4220 (patch)
tree001fb0e4f6b256f07851936f74d0805f931b63e8 /drivers/net/bonding
parentd63ddcec20f59e78212aeaf5144e9652c0097211 (diff)
bonding: Use msecs_to_jiffies, eliminate panic
Convert bonding to use msecs_to_jiffies instead of doing the math. For the ARP monitor, there was an underflow problem that could result in an infinite loop. The miimon already had that worked around, but this is cleaner. Originally by Nicolas de Pesloüan <nicolas.2p.debian@free.fr> Jay Vosburgh corrected a math error in the original; Nicolas' original commit message is: When setting arp_interval parameter to a very low value, delta_in_ticks for next arp might become 0, causing an infinite loop. See http://bugzilla.kernel.org/show_bug.cgi?id=10680 Same problem for miimon parameter already fixed, but fix might be enhanced, by using msecs_to_jiffies() function. Signed-off-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 50a40e433154..12c71582f4f6 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2397,7 +2397,7 @@ void bond_mii_monitor(struct work_struct *work)
2397 read_lock(&bond->lock); 2397 read_lock(&bond->lock);
2398 } 2398 }
2399 2399
2400 delay = ((bond->params.miimon * HZ) / 1000) ? : 1; 2400 delay = msecs_to_jiffies(bond->params.miimon);
2401 read_unlock(&bond->lock); 2401 read_unlock(&bond->lock);
2402 queue_delayed_work(bond->wq, &bond->mii_work, delay); 2402 queue_delayed_work(bond->wq, &bond->mii_work, delay);
2403} 2403}
@@ -2707,7 +2707,7 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
2707 2707
2708 read_lock(&bond->lock); 2708 read_lock(&bond->lock);
2709 2709
2710 delta_in_ticks = (bond->params.arp_interval * HZ) / 1000; 2710 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
2711 2711
2712 if (bond->kill_timers) { 2712 if (bond->kill_timers) {
2713 goto out; 2713 goto out;
@@ -2837,7 +2837,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
2837 2837
2838 read_lock(&bond->lock); 2838 read_lock(&bond->lock);
2839 2839
2840 delta_in_ticks = (bond->params.arp_interval * HZ) / 1000; 2840 delta_in_ticks = msecs_to_jiffies(bond->params.arp_interval);
2841 2841
2842 if (bond->kill_timers) { 2842 if (bond->kill_timers) {
2843 goto out; 2843 goto out;