All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Michael Leun <lkml20100708@newton.leun.net>
Cc: Greg KH <greg@kroah.com>,
	netdev@vger.kernel.org, davem@davemloft.net,
	linux-kernel@vger.kernel.org,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: NET_NS: unregister_netdevice: waiting for lo to become free (adding ipv6 address to interface)
Date: Thu, 05 Aug 2010 12:57:59 -0700	[thread overview]
Message-ID: <m1bp9g7ry0.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20100805134707.0442a7b1@xenia.leun.net> (Michael Leun's message of "Thu\, 5 Aug 2010 13\:47\:07 +0200")

Michael Leun <lkml20100708@newton.leun.net> writes:

> On Thu, 05 Aug 2010 02:51:29 -0700
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>> >> > Jul 10 20:02:36 doris kernel: unregister_netdevice: waiting for
>> >> > lo to become free. Usage count = 3 [repeated]
>> >> 
>> >> How many times?
>> >
>> > Unfortunately looks like indefinitely. Never watched longer so far
>> > (rebooted soon), but I'm seeing this message now repeated every 10
>> > secs for ~10 minutes on a idle system.
>> 
>> Ugh.  A real bug then.  These can be a pain to track down and fix. I
>> think the last one of these I tracked down took a couple of weeks.  I
>> will start digging in when I get back from vacation.
>
> OK, fortunately (hopefully) you have not put to much time onto that so
> far - because everything I told about usage of tun and difference
> between ssh and openvpn is complete nonsense.
>
> I happen to have an script in that openvpn config, which puts an ipv6
> address on the vpn device.
>
> Putting an ipv6 address on a device seems to be the trigger:
>
> OrigNS > # ip link add type veth
> OrigNS > # ip link set dev veth0 up
> OrigNS > # unshare -n /bin/bash
> NewNS > # echo $$
> <SomePID>
> OrigNS > # ip link set dev veth1 netns <SomePID> # this, of course is on a different terminal
> NewNS > # ip link set dev veth1 up
> NewNS > # ip -6 addr add dev veth1 fd50:dead:beef::1/64
> NewNS > # exit
>
> Yields
>
> kernel: unregister_netdevice: waiting for veth1 to become free. Usage count = 3
>
> Oh - its veth1 this time, not lo - add an "ip link set up dev lo" in the above scenario just after the unshare, and you get the message with lo.
>
> One might ask, if
>
>> # unshare -n /bin/bash
>> # ip link set up dev lo
>> # ip -6 addr add dev veth1 fd50:dead:beef::1/64
>> # exit
>
> also does the trick, so I tried it - and it does NOT.
>
> In the above scenario, not setting veth0 and veth1 up also makes it not happen. Only setting veth1 up also is not enough (seems to need to be "really up" what as you shurely know with veth is only the case when both sides are up).
>
> I hope, this makes it somewhat easier to track that down.

What puzzles me is that on a slightly patched 2.6.32 (so sysfs works)
and I am doing very similar things (openvpn tunnels, ipv6 to the
network as a whole etc), and I am not seeing the infinite
unregister_netdevice: messages you are talking about.

When a network device is removed most references to it are redirected
to the loopback device so a normal network device should not see the
worst of the problems.  That is why lo showed up.

In that context I'm a bit surprised you managed trigger a problem on veth1.

I wonder what has changed with ipv6 recently.

Eric

  reply	other threads:[~2010-08-05 19:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-08 16:40 sysfs bug when using tun with network namespaces Michael Leun
2010-07-09 23:57 ` Greg KH
2010-07-10  8:15   ` Michael Leun
2010-07-10 14:08     ` Greg KH
2010-07-10 14:52       ` Michael Leun
2010-07-10 21:53         ` NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn) (was Re: sysfs bug when using tun with network namespaces) Michael Leun
2010-07-11 14:16           ` Greg KH
2010-07-11 17:29           ` FW: " Michael Leun
2010-08-04 13:35             ` Michael Leun
2010-08-04 21:46               ` Greg KH
2010-08-04 22:04                 ` NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn) Eric W. Biederman
2010-08-04 22:11                 ` NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn) (was Re: sysfs bug when using tun with network namespaces) Michael Leun
2010-08-05  0:12                   ` Eric W. Biederman
2010-08-05  9:25                     ` Michael Leun
2010-08-05  9:25                       ` Michael Leun
2010-08-05  9:51                       ` NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn) Eric W. Biederman
2010-08-05  9:51                         ` Eric W. Biederman
2010-08-05 10:13                         ` Michael Leun
2010-08-05 11:47                         ` NET_NS: unregister_netdevice: waiting for lo to become free (adding ipv6 address to interface) Michael Leun
2010-08-05 19:57                           ` Eric W. Biederman [this message]
2010-08-05 20:11                             ` David Miller
2010-08-05 23:45                               ` lkml20100708
2010-08-06  0:09                             ` Michael Leun
2010-10-21 15:15                           ` Michael Leun
2010-10-22 12:48                             ` David Lamparter
2010-10-22 17:05                               ` Michael Leun
2010-10-24 13:15                                 ` Michael Leun
2010-12-06 16:08                                   ` Menil Jean-Philippe
2010-12-06 21:22                                     ` Eric W. Biederman
2010-12-06 22:47                                       ` Michael Leun
2010-12-07 10:40                                         ` Menil Jean-Philippe
2010-08-05 16:57                         ` NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn) Ben Greear

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=m1bp9g7ry0.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=greg@kroah.com \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml20100708@newton.leun.net \
    --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.