[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100331105559.5607.38643.sendpatchset@localhost.localdomain>
Date: Wed, 31 Mar 2010 06:52:13 -0400
From: Amerigo Wang <amwang@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Jiri Pirko <jpirko@...hat.com>,
Stephen Hemminger <shemminger@...tta.com>,
netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Amerigo Wang <amwang@...hat.com>,
bonding-devel@...ts.sourceforge.net,
Jay Vosburgh <fubar@...ibm.com>
Subject: [Patch] bonding: fix potential deadlock in bond_uninit()
bond_uninit() is invoked with rtnl_lock held, when it does destroy_workqueue()
which will potentially flush all works in this workqueue, if we hold rtnl_lock
again in the work function, it will deadlock.
So unlock rtnl_lock before calling destroy_workqueue().
Signed-off-by: WANG Cong <amwang@...hat.com>
Cc: Jay Vosburgh <fubar@...ibm.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Stephen Hemminger <shemminger@...tta.com>
Cc: Jiri Pirko <jpirko@...hat.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>
---
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5b92fbf..b781728 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4542,8 +4542,11 @@ static void bond_uninit(struct net_device *bond_dev)
bond_remove_proc_entry(bond);
- if (bond->wq)
+ if (bond->wq) {
+ rtnl_unlock();
destroy_workqueue(bond->wq);
+ rtnl_lock();
+ }
netif_addr_lock_bh(bond_dev);
bond_mc_list_destroy(bond);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists