Subject: Re: [PATCH net-2.6] bonding:restore backup and inactive flag of slave

From: WANG Cong <[email-masked]>
Date: Mon, 15 Aug 2011 16:18:12 +0000 (UTC)

On Mon, 15 Aug 2011 18:25:16 +0800, Weiping Pan wrote:

> 
> diff --git a/drivers/net/bonding/bond_main.c
> b/drivers/net/bonding/bond_main.c index 38a83ac..3ed9827 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -3419,9 +3419,27 @@ static int bond_xmit_hash_policy_l2(struct 
sk_buff *skb, int count)
>  static int bond_open(struct net_device *bond_dev) {
>  	struct bonding *bond = netdev_priv(bond_dev);
> +	struct slave *slave;
> +	int i;
>  
>  	bond->kill_timers = 0;
>  
> +	// restore slave->backup and slave->inactive

Please use C-style comment.

> +	read_lock(&bond->lock);
> +	read_lock(&bond->curr_slave_lock);
> +	if (bond->slave_cnt > 0) {

You can move the second read_lock() under this if().