All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsa@cumulusnetworks.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: [BUG net-next] infamous dev refcnt leak... again.
Date: Fri, 14 Aug 2015 17:19:18 -0600	[thread overview]
Message-ID: <55CE7776.5000706@cumulusnetworks.com> (raw)
In-Reply-To: <1439594063.7507.11.camel@edumazet-glaptop2.roam.corp.google.com>

On 8/14/15 5:14 PM, Eric Dumazet wrote:
> On Fri, 2015-08-14 at 14:14 -0700, Eric Dumazet wrote:
>> While rebooting host running latest net-next
>>
>>   unregister_netdevice: waiting for eth0 to become free. Usage count = 4
>>
>> Oh well...
>>
>
> It looks like David Ahern recent changes uncover a bug ?
>
> Not clear which commit is at fault.
>
> Maybe 3bfd847203c6d89532f836ad3f5b4ff4ced26dd9 ?
>
> Somehow a down device can be found.

Can you elaborate on what you are doing to see the refcnt leak? I have 
not seen that at all. I have to leave for soccer carpool in 45 minutes 
or so, but can take a look this weekend.

David

>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index b7f1d20..675a3b6 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -725,10 +725,14 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
>   		nh->nh_dev = dev = FIB_RES_DEV(res);
>   		if (!dev)
>   			goto out;
> -		dev_hold(dev);
>   		if (!netif_carrier_ok(dev))
>   			nh->nh_flags |= RTNH_F_LINKDOWN;
> -		err = (dev->flags & IFF_UP) ? 0 : -ENETDOWN;
> +		if (dev->flags & IFF_UP) {
> +			err = 0;
> +			dev_hold(dev);
> +		} else {
> +			err = -ENETDOWN;
> +		}
>   	} else {
>   		struct in_device *in_dev;
>
>
>

  reply	other threads:[~2015-08-14 23:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 21:14 [BUG net-next] infamous dev refcnt leak... again Eric Dumazet
2015-08-14 23:14 ` Eric Dumazet
2015-08-14 23:19   ` David Ahern [this message]
2015-08-14 23:31     ` Eric Dumazet
2015-08-15  0:26       ` Eric Dumazet
2015-08-15 17:54       ` [PATCH net-next] ipv4: fix refcount leak in fib_check_nh() Eric Dumazet
2015-08-15 20:36         ` David Ahern
2015-08-17  5:14         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CE7776.5000706@cumulusnetworks.com \
    --to=dsa@cumulusnetworks.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.