From: Herbert Poetzl <herbert@13thfloor.at>
To: Valdis.Kletnieks@vt.edu
Cc: Andrew Morton <akpm@osdl.org>,
torvalds@osdl.org, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@lst.de>
Subject: Re: 2.6.17-rc3 - fs/namespace.c issue
Date: Tue, 2 May 2006 18:48:51 +0200 [thread overview]
Message-ID: <20060502164851.GJ22195@MAIL.13thfloor.at> (raw)
In-Reply-To: <200605020656.k426uO7H002518@turing-police.cc.vt.edu>
On Tue, May 02, 2006 at 02:56:23AM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Tue, 02 May 2006 01:56:37 +0200, Herbert Poetzl said:
> > > > http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6422f17d3a480f21917a3895e2a46b968f56a08
>
> > first, what do we expect from --bind mounts regarding
> > vfs (mount) level flags like noatime, noexec, nodev?
> >
> > - should they be propagated from the original mfs/mount?
>
> I tripped over this apparent regression when I hit a problem with some
> code that expected this behavior. Given the documented behavior of the
> mount syscall (see below), apparently propagating all flags intact
> and clearing all flags are the only 2 options that don't break the
> documented API.
>
> > - should they only restrict the original set?
> > - should they allow to modify the existing flags?
>
> Well, absent a '-o newflags' to modify it, propagating the originals
> probably follows the Principle of Least Surprise. And whether mountflags
> are permissible is an API change issue...
>
> > IMHO, it makes perfect sense to mount something noatime
> > and change that rule later for a subtree like this:
> >
> > mkdir /foo
> > mount -t tmpfs -o rw,noatime none /foo
> > mkdir /foo/bar
> > mount --bind -o atime /foo/bar /foo/bar
>
> Here, there's a -o parameter being passed.
yes, but this information unfortunately cannot be passed
to the kernel, assuming that we 'preserve' the original
mount flags, as there simply is no 'atime' flag, just an
MS_NOATIME flag, which in this case is not set :)
> > second, has the kernel to decide what flags userspace
> > can request and/or change, depending on the original?
>
> Can of worms, too complicated for 3AM. :)
>
> > and finally, how to handle --rbind mounts at a level
> > deeper than the top?
>
> More worms. ;)
it's full of worms, maybe we should add a new option or
even a new mount type for this?
maybe we should allow remount on bind mounts, and keep
the original (copy all) behaviour intact for --bind and
--rbind mounts? (that would look most natural to me)
suggestions welcome!
best,
Herbert
> Note that any provision for changing the mountflags *IS* a break of
> the documented API. 'man 2 mount' says specifically:
>
> MS_BIND
> (Linux 2.4 onwards) Perform a bind mount, making a
> file or a directory subtree visible at another point
> within a file system. Bind mounts may cross file system
> boundaries and span chroot(2) jails. The filesystemtype,
> mountflags, and data arguments are ignored.
>
> I admit not knowing that whether POSIX or other standards specify that
> mountflags be ignored.
next prev parent reply other threads:[~2006-05-02 16:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-01 21:06 Valdis.Kletnieks
2006-05-01 21:33 ` Andrew Morton
2006-05-01 23:56 ` Herbert Poetzl
2006-05-02 6:56 ` Valdis.Kletnieks
2006-05-02 16:48 ` Herbert Poetzl [this message]
2006-05-15 21:18 ` Bill Davidsen
2006-05-12 17:36 ` Stephen Smalley
2006-05-12 17:53 ` Andrew Morton
2006-05-12 18:02 ` Stephen Smalley
2006-05-12 18:09 ` Andrew Morton
2006-05-13 13:54 ` Herbert Poetzl
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=20060502164851.GJ22195@MAIL.13thfloor.at \
--to=herbert@13thfloor.at \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@osdl.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®