From 5655662dab4ef044be7efd155f2f5fef2e486545 Mon Sep 17 00:00:00 2001 From: Jay Vosburgh Date: Thu, 17 Jan 2008 16:25:03 -0800 Subject: [PATCH] bonding: Don't hold lock when calling rtnl_unlock Change bond_mii_monitor to not hold any locks when calling rtnl_unlock, as rtnl_unlock can sleep (when acquring another mutex in netdev_run_todo). Bug reported by Makito SHIOKAWA , who included a different patch. Signed-off-by: Jay Vosburgh Signed-off-by: Jeff Garzik --- drivers/net/bonding/bond_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2c6da49693..49a198206e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2386,7 +2386,9 @@ void bond_mii_monitor(struct work_struct *work) rtnl_lock(); read_lock(&bond->lock); __bond_mii_monitor(bond, 1); - rtnl_unlock(); + read_unlock(&bond->lock); + rtnl_unlock(); /* might sleep, hold no other locks */ + read_lock(&bond->lock); } delay = ((bond->params.miimon * HZ) / 1000) ? : 1; -- 2.39.5