Subject: Re: [PATCH] bonding: Do not try to send packets over dead link in TLB mode.

From: Veaceslav Falico <[email-masked]>
Date: Wed, 9 Jul 2014 15:27:10 +0200

On Wed, Jul 09, 2014 at 03:17:29PM +0200, Eric Dumazet wrote:
>On Wed, 2014-07-09 at 14:04 +0200, Veaceslav Falico wrote:
>> On Wed, Jul 09, 2014 at 12:25:43PM +0200, Nikolay Aleksandrov wrote:
>> >On 07/09/2014 12:24 PM, Veaceslav Falico wrote:
>> >> On Tue, Jul 08, 2014 at 06:09:58PM -0700, Mahesh Bandewar wrote:
>> ...snip...
>> >>> +    spin_lock(&bond_info->slave_arr_lock);
>> >>
>> >> I don't think you can re-enter bond_alb_handle_link_change(), as it's
>> >> protected either by rtnl or write-lock curr_active_slave.
>> >>
>> >Actually a very good catch :-)
>> >Maybe the allocation above should be done with GFP_ATOMIC.
>>
>> For the record - it's indeed always under rtnl, so ASSERT_RTNL() (from your
>> other email) is a good idea.
>
>Strange. I basically suggested the ASSERT_RTNL() to Mahesh few days ago
>and he tried this. But the assert triggered with miimon, so Mahesh added
>back the spinlock.

That's indeed strange... From the code:

2103                 if (!rtnl_trylock()) {
2104                         delay = 1;
2105                         should_notify_peers = false;
2106                         goto re_arm;
2107                 }
2108
2109                 bond_miimon_commit(bond);
2110
2111                 rtnl_unlock();  /* might sleep, hold no other locks */

And we can get there only through bond_miimon_commit(), as part of the
miimon.

Maybe you've hit the kmalloc(GFP_KERNEL) warning?