From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <shemming@brocade.com>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>, netdev@vger.kernel.org
Subject: [iproute PATCH 1/2] ipnetns: Move NETNS_RUN_DIR into it's own propagation group
Date: Tue, 5 Jul 2016 16:42:52 +0200 [thread overview]
Message-ID: <1467729773-16751-2-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1467729773-16751-1-git-send-email-phil@nwl.cc>
On systems where the parent mount point is shared, NETNS_RUN_DIR
inherits the parent's propagation group. This leads to netns mount
points being propagated to the parent and thus showing up twice in the
output of 'mount'.
By making the newly mounted NETNS_RUN_DIR private first, then shared
again, it will move to it's own propagation group which will still allow
for netns mounts to propagate between mount namespaces but gets rid of
the double netns entry at the same time.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
ip/ipnetns.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index b3ee23c23aaa2..1cefe73c68bfc 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -650,6 +650,11 @@ static int netns_add(int argc, char **argv)
NETNS_RUN_DIR, NETNS_RUN_DIR, strerror(errno));
return -1;
}
+ if (mount("", NETNS_RUN_DIR, "none", MS_PRIVATE, NULL)) {
+ fprintf(stderr, "mount --make-private %s failed: %s\n",
+ NETNS_RUN_DIR, strerror(errno));
+ return -1;
+ }
made_netns_run_dir_mount = 1;
}
--
2.8.2
next prev parent reply other threads:[~2016-07-05 14:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 14:42 [iproute PATCH 0/2] Netns performance improvements Phil Sutter
2016-07-05 14:42 ` Phil Sutter [this message]
2016-07-05 14:42 ` [iproute PATCH 2/2] ipnetns: Make netns mount points private Phil Sutter
2016-07-05 14:44 ` [iproute PATCH 0/2] Netns performance improvements Eric W. Biederman
2016-07-05 20:51 ` Phil Sutter
2016-07-07 4:58 ` Eric W. Biederman
2016-07-07 11:17 ` Phil Sutter
2016-07-07 12:59 ` Nicolas Dichtel
2016-07-07 15:48 ` Phil Sutter
2016-07-07 16:16 ` Rick Jones
2016-07-07 16:34 ` Eric W. Biederman
2016-07-07 17:28 ` Rick Jones
2016-07-08 8:12 ` Eric W. Biederman
2016-07-08 14:31 ` Brian Haley
2016-07-08 8:01 ` Nicolas Dichtel
2016-07-08 17:18 ` Rick Jones
2016-07-11 12:51 ` Nicolas Dichtel
2016-07-05 14:49 ` Phil Sutter
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=1467729773-16751-2-git-send-email-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=ebiederm@xmission.com \
--cc=netdev@vger.kernel.org \
--cc=shemming@brocade.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).