netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bonding: take rtnl in bond_loadbalance_arp_mon
@ 2010-07-28 21:04 Andy Gospodarek
  2010-07-28 21:39 ` Jay Vosburgh
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Gospodarek @ 2010-07-28 21:04 UTC (permalink / raw)
  To: netdev; +Cc: fubar

With the latest code in net-next-2.6 the following (and similar) are
spewed when using arp monitoring and balance-alb.

RTNL: assertion failed at drivers/net/bonding/bond_alb.c (1663)
Pid: 1653, comm: bond0 Tainted: G        W   2.6.35-rc1-net-next #9
Call Trace:
 [<ffffffffa0385bb3>] bond_alb_handle_active_change+0x10e/0x17f [bonding]
 [<ffffffffa037f2e4>] bond_change_active_slave+0x20c/0x42f [bonding]
 [<ffffffffa0380062>] ? bond_loadbalance_arp_mon+0x1d8/0x222 [bonding]
 [<ffffffffa037f95a>] bond_select_active_slave+0xe0/0x10e [bonding]
 [<ffffffffa038006a>] bond_loadbalance_arp_mon+0x1e0/0x222 [bonding]
 [<ffffffff81065f7d>] worker_thread+0x26a/0x363
 [<ffffffff81065f25>] ? worker_thread+0x212/0x363
 [<ffffffff81048b19>] ? finish_task_switch+0x70/0xe4
 [<ffffffff81048aa9>] ? finish_task_switch+0x0/0xe4
 [<ffffffffa037fe8a>] ? bond_loadbalance_arp_mon+0x0/0x222 [bonding]
 [<ffffffff8106a45a>] ? autoremove_wake_function+0x0/0x39
 [<ffffffff81065d13>] ? worker_thread+0x0/0x363
 [<ffffffff81069f98>] kthread+0x9a/0xa2
 [<ffffffff8107b4f7>] ? trace_hardirqs_on_caller+0x111/0x135
 [<ffffffff8100aa64>] kernel_thread_helper+0x4/0x10
 [<ffffffff81475e50>] ? restore_args+0x0/0x30
 [<ffffffff81069efe>] ? kthread+0x0/0xa2
 [<ffffffff8100aa60>] ? kernel_thread_helper+0x0/0x10

This is essentially the same thing done in bond_activebackup_arp_mon to
address not holding rtnl when needed.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>

---
 drivers/net/bonding/bond_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2cc4cfc..d624cf9 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2857,11 +2857,17 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
 	}
 
 	if (do_failover) {
+		read_unlock(&bond->lock);
+		rtnl_lock();
+		read_lock(&bond->lock);
 		write_lock_bh(&bond->curr_slave_lock);
 
 		bond_select_active_slave(bond);
 
 		write_unlock_bh(&bond->curr_slave_lock);
+		read_unlock(&bond->lock);
+		rtnl_unlock();
+		read_lock(&bond->lock);
 	}
 
 re_arm:
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-31  6:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 21:04 [PATCH net-next] bonding: take rtnl in bond_loadbalance_arp_mon Andy Gospodarek
2010-07-28 21:39 ` Jay Vosburgh
2010-07-29  1:13   ` Andy Gospodarek
2010-07-29 17:49     ` Jay Vosburgh
2010-07-31  6:28       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).