All of lore.kernel.org
 help / color / mirror / Atom feed
From: Veaceslav Falico <vfalico@redhat.com>
To: "Alexander Y. Fomichev" <git.user@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: Is it normal to have cross namespace symlinks?
Date: Thu, 21 Aug 2014 14:12:05 +0200	[thread overview]
Message-ID: <20140821121205.GR9476@redhat.com> (raw)
In-Reply-To: <20140821143816.48c5ad08@mad-cat.int.e5.ru>

On Thu, Aug 21, 2014 at 02:38:16PM +0400, Alexander Y. Fomichev wrote:
>Hello guys!
>
>Recently i switched to 3.14.x stable branch and i've got a bunch of
>warnings:
>
>[   44.717746] ------------[ cut here ]------------
>[   44.717750] WARNING: CPU: 1 PID: 7007 at fs/sysfs/dir.c:52
>sysfs_warn_dup+0x86/0xa0() [   44.717751] sysfs: cannot create
>duplicate filename
>'/devices/pci0000:00/0000:00:1c.4/0000:05:00.0/net/eth1/upper_eth1'
>
>[   37.759856] ------------[ cut here ]------------
>[   37.759863] WARNING: CPU: 1 PID: 3822 at fs/sysfs/dir.c:52
>sysfs_warn_dup+0x86/0xa0() [   37.759864] sysfs: cannot create
>duplicate filename '/devices/virtual/net/bond0/upper_eth0'
>....
>
>It was triggered by renaming of macvlan interfaces in a freshly created
>network namespaces. Just start two lxc containers one by one with
>macvlans on the same lowerdev and rename devices inside containers (with
>the same name) and voila.
>v
>I investigated problem a bit and i see that code in net/core/dev.c
>which working with sysfs symlinks upper_dev / lower_dev is absolutely
>unaware of namespaces. I mean code which uses functions
>netdev_adjacent_sysfs_del,netdev_adjacent_sysfs_add
>netdev_adjacent_rename_links,dev_change_name
>just not takes into account that dev and adj_dev could be in a
>different namespaces.

That's indeed so. When I've implemented it, I indeed didn't take into
account net_ns, my bad.

Before the code, though, I'm not sure on how exactly to fix this. The only
idea which comes to mind is to prohibit inter-net_ns symlinks (which can be
done without much hassle) - i.e. to remove/add them on net_ns change, and
to prohibit creating them on adding an inter-ns upper links.

However, as I definitely lack experience using net_ns, maybe there are
other, better way, to fix this?

  reply	other threads:[~2014-08-21 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 10:38 Is it normal to have cross namespace symlinks? Alexander Y. Fomichev
2014-08-21 12:12 ` Veaceslav Falico [this message]
2014-08-21 15:13   ` Alexander Y. Fomichev
2014-08-21 15:29     ` Veaceslav Falico
2014-08-22  8:53       ` [PATCH] netdev_adjacent_sysfs_*: fix cross-namespace symlinks Alexander Y. Fomichev
2014-08-22 10:34       ` Alexander Y. Fomichev
2014-08-22 18:30         ` David Miller
2014-08-22 23:15           ` [PATCH] net: prevent of emerging " Alexander Y. Fomichev
2014-08-25  1:28             ` David Miller
2014-08-25 12:06               ` Alexander Y. Fomichev
2014-08-25 12:39                 ` Alexander Y. Fomichev
2014-08-25 12:26               ` Alexander Y. Fomichev
2014-08-25 22:18                 ` 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=20140821121205.GR9476@redhat.com \
    --to=vfalico@redhat.com \
    --cc=git.user@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.