diff mbox

bonding: fire NETDEV_RELEASE event only on 0 slaves

Message ID 1362589832-9526-1-git-send-email-vfalico@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Veaceslav Falico March 6, 2013, 5:10 p.m. UTC
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>
---
 drivers/net/bonding/bond_main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

Neil Horman March 7, 2013, 3:38 a.m. UTC | #1
On Wed, Mar 06, 2013 at 06:10:32PM +0100, Veaceslav Falico wrote:
> 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>
> ---
>  drivers/net/bonding/bond_main.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 7bd068a..8b4e96e 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -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);
> @@ -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) &&
> -- 
> 1.7.1
> 
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller March 7, 2013, 9:15 p.m. UTC | #2
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 6 Mar 2013 22:38:19 -0500

> On Wed, Mar 06, 2013 at 06:10:32PM +0100, Veaceslav Falico wrote:
>> 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>

Applied, thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7bd068a..8b4e96e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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);
@@ -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) &&