From: Al Viro <viro@ftp.linux.org.uk>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Ram Pai <linuxram@us.ibm.com>, Miklos Szeredi <miklos@szeredi.hu>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 12/18] shared mount handling: bind and rbind
Date: Wed, 9 Nov 2005 19:26:07 +0000 [thread overview]
Message-ID: <20051109192607.GA7992@ftp.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0511091054290.3247@g5.osdl.org>
On Wed, Nov 09, 2005 at 10:59:47AM -0800, Linus Torvalds wrote:
>
>
> On Wed, 9 Nov 2005, Ram Pai wrote:
> >
> > And 'umount .' really doen't make sense. What does it mean? umount the
> > current mount? or umount of the mount that is mounted on this dentry?
>
> "umount <directory>" _absolutely_ makes sense, whether "directory" is "."
> or something else. People do it all the time.
With current (and all previous, actually) tree umount . is usually -EBUSY.
The case Mikulas is talking about is much uglier - it's "mount on top
of current directory, then umount .". _That_ (i.e. when . is overmounted)
happens to work. And semantics is really, really not well-defined.
Situation with overmounts is nasty - it's *not* just a chain, unfortunately.
I certainly intended it to be such. However, we can get a *tree* of
overmounts due to side-effects I've missed back then.
We really need it sanitized (and that's what I'm doing right now), but
yes, it *will* cause user-visible changes. Incidentally, one of those
will be that umount . will work...
The trouble begins since we allow to attach vfsmounts to the *middle* of
overmount chain. I.e.
mount foo /tmp
cd /tmp
mount bar .
mount baz .
will end up with *two* vfsmounts having root of foo as mountpoint and having
the same mnt_parent. Which one is seen depends on phase of moon - the only
answer is "whichever is first in mnt_hash chain". Which is certainly not a
sane answer. We need explicit rules dealing with effect of overmounts;
anything that seriously relies on details of current behaviour in that sort
of corner cases is very definitely broken.
And "we allow" above should be read as "Al had not thought about that mess
back in 2001" ;-/ Current behaviour in that sort setups is an accident -
as soon as it gets to such forked chains of overmounts sanity exits stage
left. To be fixed...
next prev parent reply other threads:[~2005-11-09 19:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-08 2:01 [PATCH 12/18] shared mount handling: bind and rbind Al Viro
2005-11-08 14:11 ` Miklos Szeredi
2005-11-08 15:48 ` Ram Pai
2005-11-08 15:55 ` Miklos Szeredi
2005-11-09 18:44 ` Ram Pai
2005-11-09 18:59 ` Linus Torvalds
2005-11-09 19:26 ` Al Viro [this message]
2005-11-09 19:28 ` Ram Pai
2005-11-16 3:29 ` Rob Landley
2005-11-16 3:53 ` Linus Torvalds
2005-11-16 5:35 ` Al Boldi
2005-11-16 8:19 ` Miklos Szeredi
2005-11-16 9:10 ` Rob Landley
2005-11-16 10:14 ` Miklos Szeredi
2005-11-16 13:59 ` Shaya Potter
2005-11-16 16:35 ` Miklos Szeredi
2005-11-16 20:05 ` Al Boldi
2005-11-16 20:21 ` Shaya Potter
2005-11-16 8:47 ` Rob Landley
2005-11-16 8:41 ` Rob Landley
2005-11-16 16:18 ` Linus Torvalds
2005-11-09 10:54 ` Miklos Szeredi
2005-11-09 14:31 ` Al Viro
2005-11-09 15:22 ` Miklos Szeredi
2005-11-09 15:56 ` Al Viro
2005-11-09 16:33 ` Miklos Szeredi
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=20051109192607.GA7992@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=miklos@szeredi.hu \
--cc=torvalds@osdl.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).