From: Al Viro <viro@ZenIV.linux.org.uk>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: How to unmount mounts corresponding to super_block structure?
Date: Wed, 27 Feb 2013 06:56:41 +0000 [thread overview]
Message-ID: <20130227065641.GN4503@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAOMFOmWJyzd4tLigS6sYBw0qyTMO_MNEBi_4CJS2hUOkQJbKgg@mail.gmail.com>
On Tue, Feb 26, 2013 at 10:35:12PM -0800, Anatol Pomozov wrote:
> What I am trying to do is to iterate current filesystem namespace and
> find mountpoints that correspond to super_block. Namespace can have
> multiple corresponding mountpoints in case of bind mounts. Here is
> code that seems to work fine http://pastebin.com/xLECPGa4 . Now I am
> trying to understand what synchronization is required for this code.
> It looks like access to nsproxy->mnt_ns->list should be done with
> namespace_sem held. Unfortunately that semaphore is internal to
> fs/namespace.c. It is not clear for me how I suppose to iterate the
> mount list.
>
> Is there any advice/code example how to umount() mountpoints for a
> given super_block?
Simple: don't. This is fundamentally wrong thing to do. Not to mention
anything else, there may be more than one namespace out there. This
operation makes no sense.
Incidentally, anybody adding includes of fs/mount.h would better be ready
to explain {What,Why}TF is being done. There's a damn good reason why
this list is outside of public struct vfsmount...
next prev parent reply other threads:[~2013-02-27 6:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 6:35 How to unmount mounts corresponding to super_block structure? Anatol Pomozov
2013-02-27 6:56 ` Al Viro [this message]
2013-02-27 7:19 ` Anatol Pomozov
2013-02-27 7:43 ` Al Viro
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=20130227065641.GN4503@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=anatol.pomozov@gmail.com \
--cc=linux-fsdevel@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).