From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Alexander Aring <aring@mojatatu.com>, netdev@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, kernel@mojatatu.com,
David Howells <dhowells@redhat.com>
Subject: Re: [RFC iproute2 1/1] ip: netns: add mounted state file for each netns
Date: Thu, 27 Jun 2019 14:08:08 +0200 [thread overview]
Message-ID: <293c9bd3-f530-d75e-c353-ddeabac27cf6@6wind.com> (raw)
In-Reply-To: <20190626190343.22031-2-aring@mojatatu.com>
Le 26/06/2019 à 21:03, Alexander Aring a écrit :
> This patch adds a state file for each generated namespace to ensure the
> namespace is mounted. There exists no way to tell another programm that
> the namespace is mounted when iproute is creating one. An example
> application would be an inotify watcher to use the generated namespace
> when it's discovers one. In this case we cannot use the generated
> namespace file in /var/run/netns in the time when it's not mounted yet.
> A primitiv approach is to generate another file after the mount
> systemcall was done. In my case inotify waits until the mount statefile
> is generated to be sure that iproute2 did a mount bind.
We (at 6WIND) already hit this problem. The solution was: if setns() fails, wait
a bit and retry the setns() and continue this loop with a predefined timeout.
netns may be created by other app than iproute2, it would be nice to find a
generic solution.
David Howells was working on a mount notification mechanism:
https://lwn.net/Articles/760714/
https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=notifications
I don't know what is the status of this series.
Regards,
Nicolas
next prev parent reply other threads:[~2019-06-27 12:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 19:03 [RFC iproute2 0/1] iproute2 netns mount race issue and solution? Alexander Aring
2019-06-26 19:03 ` [RFC iproute2 1/1] ip: netns: add mounted state file for each netns Alexander Aring
2019-06-27 12:08 ` Nicolas Dichtel [this message]
2019-06-28 16:26 ` David Howells
2019-06-28 17:06 ` Matteo Croce
2019-06-29 21:45 ` Matteo Croce
2019-07-01 12:34 ` Nicolas Dichtel
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=293c9bd3-f530-d75e-c353-ddeabac27cf6@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=aring@mojatatu.com \
--cc=dhowells@redhat.com \
--cc=kernel@mojatatu.com \
--cc=linux-fsdevel@vger.kernel.org \
--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 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).