bonding: get netdev_rx_handler_unregister out of locks
Subsystems (3)
PATCH 1/1 bonding: get netdev_rx_handler_unregister out of locks
Now that netdev_rx_handler_unregister contains synchronize_net(), we need to call it outside of bond->lock, cause it might sleep. Also, remove the already unneded synchronize_net().
--- drivers/net/bonding/bond_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_main.c +1 -2
@@ -1975,12 +1975,11 @@ static int __bond_release_one(struct net_device *bond_dev,return -EINVAL ; } +write_unlock_bh (&bond->lock);/* unregister rx_handler early so bond_handle_frame wouldn't be called * for this slave anymore. */ netdev_rx_handler_unregister (slave_dev); -write_unlock_bh (&bond->lock); -synchronize_net ();write_lock_bh (&bond->lock);if (!all && !bond->params.fail_over_mac) {
Signature · 1 line
1.7.1
Quoted 17 lines · Veaceslav Falico
Now that
netdev_rx_handler_unregistercontainssynchronize_net(), we need to call it outside ofbond->lock, cause it might sleep. Also, remove the already unnededsynchronize_net().Signed-off-by Veaceslav Falico <[email protected]>--- drivers/net/bonding/bond_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/bonding/bond_main.c +0
-0@@ -1975,12 +1975,11 @@ static int __bond_release_one(struct net_device *bond_dev,return -EINVAL ; }
drivers/net/bonding/bond_main.c static int __bond_release_one(struct net_device *bond_dev, · line 1985
Quoted 10 lines
drivers/net/bonding/bond_main.c +1
-2+write_unlock_bh (&bond->lock);/* unregister rx_handler early so bond_handle_frame wouldn't be called * for this slave anymore. */ netdev_rx_handler_unregister (slave_dev); -write_unlock_bh (&bond->lock); -synchronize_net ();write_lock_bh (&bond->lock);if (!all && !bond->params.fail_over_mac) {
Good catch, thanks !
I'll send a net-next patch to remove the synchronize_net() from bridge code as well.
Quoted 27 lines · Eric Dumazet
Quoted 26 lines · Veaceslav Falico
Now that
netdev_rx_handler_unregistercontainssynchronize_net(), we need to call it outside ofbond->lock, cause it might sleep. Also, remove the already unnededsynchronize_net().Signed-off-by Veaceslav Falico <[email protected]>--- drivers/net/bonding/bond_main.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)drivers/net/bonding/bond_main.c +1
-2@@ -1975,12 +1975,11 @@ static int __bond_release_one(struct net_device *bond_dev,return -EINVAL ; } +write_unlock_bh (&bond->lock);/* unregister rx_handler early so bond_handle_frame wouldn't be called * for this slave anymore. */ netdev_rx_handler_unregister (slave_dev); -write_unlock_bh (&bond->lock); -synchronize_net ();write_lock_bh (&bond->lock);
Quoted 8 lines
drivers/net/bonding/bond_main.c static int __bond_release_one(struct net_device *bond_dev, · line 1985
Quoted 1 line
drivers/net/bonding/bond_main.c +0
-0if (!all && !bond->params.fail_over_mac) {Good catch, thanks !
Acked-by Eric Dumazet <[email protected]>I'll send a net-next patch to remove the
synchronize_net()from bridge code as well.
Nice, when I've checked it not to be under other locks I've somehow missed the part where the bridge calls synchronize_net() right after it.
Thank you!
Quoted 3 lines
From: Eric Dumazet <[email protected]>
Date: Tue, 02 Apr 2013 08:26:02 -0700
Quoted 6 lines · Veaceslav Falico
Quoted 5 lines
Now that
netdev_rx_handler_unregistercontainssynchronize_net(), we need to call it outside ofbond->lock, cause it might sleep. Also, remove the already unnededsynchronize_net().Signed-off-by Veaceslav Falico <[email protected]>
...
Quoted 1 line
Acked-by Eric Dumazet <[email protected]>
Applied, thanks.