Skip to content

Commit

Permalink
bonding: fire NETDEV_RELEASE event only on 0 slaves
Browse files Browse the repository at this point in the history
Currently, if we set up netconsole over bonding and release a slave,
netconsole will stop logging on the whole bonding device. Change the
behavior to stop the netconsole only when the last slave is released.

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Veaceslav Falico authored and David S. Miller committed Mar 7, 2013
1 parent 9cb6cb7 commit 80028ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,6 @@ static int __bond_release_one(struct net_device *bond_dev,
}

block_netpoll_tx();
call_netdevice_notifiers(NETDEV_RELEASE, bond_dev);
write_lock_bh(&bond->lock);

slave = bond_get_slave_by_dev(bond, slave_dev);
Expand Down Expand Up @@ -2066,8 +2065,10 @@ static int __bond_release_one(struct net_device *bond_dev,
write_unlock_bh(&bond->lock);
unblock_netpoll_tx();

if (bond->slave_cnt == 0)
if (bond->slave_cnt == 0) {
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
call_netdevice_notifiers(NETDEV_RELEASE, bond->dev);
}

bond_compute_features(bond);
if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&
Expand Down

0 comments on commit 80028ea

Please sign in to comment.