linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <valerie.aurora@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH 00/74] Union mounts version something or other
Date: Sun, 24 Apr 2011 14:48:31 -0700	[thread overview]
Message-ID: <BANLkTinS2XXD4atoGdun7kp=_XVE2RFgrg@mail.gmail.com> (raw)
In-Reply-To: <8873.1303391374@redhat.com>

On Thu, Apr 21, 2011 at 6:09 AM, David Howells <dhowells@redhat.com> wrote:
> Valerie Aurora <valerie.aurora@gmail.com> wrote:
>
>> That's never up to date, but I just fixed it.  The branch you want is
>> "ext2_cleanup".  Any branch with "+" at the front is a mistake from
>> trying to do a git push of a rebased branch.  I deleted it.
>
> Okay, I've got that pulled up to Linus's head branch.  I've mostly got the RCU
> pathwalk and managed dentry stuff correctly entangled.

Awesome, thanks!

> However, I have a few questions:
>
>  (1) Is it meant to be possible to unionmount over a mount tree rather than
>     just a single mount?  I ask because do_lookup_union() calls
>     __follow_mount().

It's meant to allow mounting over a mount tree, as long as all the
mounts are read-only.   I don't recall the difference between
__follow_mount() and follow_mount() at this moment, but that code may
be left over from the time that we could only union mount a single
mount.

Think about it carefully though, and check my comments, and run the
union mounts test suite - I got this wrong a few times and added a
number of tests to make sure the mount point case is right.

>  (2) When you open a file that exists in the lower layer but not the top
>     layer, am I right in thinking that f_path points to the lower layer file?

If the file is opened read-write, then it is copied up and the f_path
points to the upper layer file.  If the file is opened read-only, then
it is not copied up and the f_path points to the lower layer file.
So, yes, f_path points to the lower layer file.

>  (3) If I'm correct in (2), I presume something must intercept fchown() and
>     suchlike?

There's a thread somewhere on this, hang on...

http://kerneltrap.org/mailarchive/linux-fsdevel/2010/3/29/6897953/thread

Basically, if you open the file read-write and do an fchown() on it,
it works fine because the file is copied up on open.  If you open the
file read-only and fchown() it (yes, that's permitted) then in union
mounts you will get EPERM or EBADF (don't recall which).  Actually
implementing this requires copy-up after open, which requires atomic
update of the struct file pointer, which is ugly and painful and what
we were trying to avoid in the first place.

I discussed this with Al and Christoph and the consensus was along the
lines of, "What?  You can do that?  POSIX is so stupid.  Yes, we don't
care if union mounts returns EPERM in this case that no one thinks
should work anyway."

If you can find a way to do this cleanly, hurray.  Otherwise the
current code works for fchown/fchmod/utimensat already in the open
read-write case.

>  (4) I presume IS_DIR_UNIONED() only gives true on the upper layer (the one
>     that was mounted -o union)?

Yes.  It maybe should be renamed...

Thanks,

-VAL

      reply	other threads:[~2011-04-24 21:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23  1:58 [PATCH 00/74] Union mounts version something or other Valerie Aurora
2011-03-23  1:58 ` [PATCH 01/74] VFS: Comment follow_mount() and friends Valerie Aurora
2011-03-23  1:58 ` [PATCH 02/74] VFS: Make lookup_hash() return a struct path Valerie Aurora
2011-03-23  1:58 ` [PATCH 03/74] autofs4: Save autofs trigger's vfsmount in super block info Valerie Aurora
2011-03-23  1:58 ` [PATCH 04/74] Documentation: Fix trivial typo in filesystems/sharedsubtree.txt Valerie Aurora
2011-03-23  1:58 ` [PATCH 05/74] whiteout/NFSD: Don't return information about whiteouts to userspace Valerie Aurora
2011-03-23  1:58 ` [PATCH 06/74] whiteout: Define opaque inode flags and operations Valerie Aurora
2011-03-23  1:58 ` [PATCH 07/74] whiteout: Add vfs_whiteout() and whiteout inode operation Valerie Aurora
2011-03-23  1:58 ` [PATCH 08/74] whiteout: Allow removal of a directory with whiteouts Valerie Aurora
2011-03-23  1:58 ` [PATCH 09/74] whiteout: tmpfs whiteout support Valerie Aurora
2011-03-23  1:58 ` [PATCH 10/74] ext2: Add ext2_dirent_in_use() Valerie Aurora
2011-03-23  1:58 ` [PATCH 11/74] ext2: Split ext2_add_entry() from ext2_add_link() Valerie Aurora
2011-03-23  1:58 ` [PATCH 12/74] whiteout: ext2 whiteout support Valerie Aurora
2011-03-23  1:58 ` [PATCH 13/74] whiteout: jffs2 " Valerie Aurora
2011-03-23  1:58 ` [PATCH 14/74] fallthru: Basic fallthru definitions Valerie Aurora
2011-03-23  1:58 ` [PATCH 15/74] fallthru: ext2 fallthru support Valerie Aurora
2011-03-23  1:58 ` [PATCH 16/74] fallthru: tmpfs " Valerie Aurora
2011-03-23  1:58 ` [PATCH 17/74] fallthru: jffs2 " Valerie Aurora
2011-03-23  1:58 ` [PATCH 18/74] VFS: Add hard read-only users count to superblock Valerie Aurora
2011-03-23  1:58 ` [PATCH 19/74] VFS: Make clone_mnt()/copy_tree()/collect_mounts() return errors Valerie Aurora
2011-03-23  1:58 ` [PATCH 20/74] VFS: Add CL_NO_SHARED flag to clone_mnt()/copy_tree() Valerie Aurora
2011-03-23  1:58 ` [PATCH 21/74] VFS: Add CL_NO_SLAVE " Valerie Aurora
2011-03-23  1:58 ` [PATCH 22/74] VFS: Add CL_MAKE_HARD_READONLY " Valerie Aurora
2011-03-23  1:58 ` [PATCH 23/74] union-mount: Union mounts documentation Valerie Aurora
2011-03-23  1:59 ` [PATCH 24/74] union-mount: Introduce MNT_UNION and MS_UNION flags Valerie Aurora
2011-03-23  1:59 ` [PATCH 25/74] union-mount: Add CONFIG_UNION_MOUNT option Valerie Aurora
2011-03-23  1:59 ` [PATCH 26/74] union-mount: Create union_stack structure Valerie Aurora
2011-03-23  1:59 ` [PATCH 27/74] union-mount: Add two superblock fields for union mounts Valerie Aurora
2011-03-23  1:59 ` [PATCH 28/74] union-mount: Add union_alloc() Valerie Aurora
2011-03-23  1:59 ` [PATCH 29/74] union-mount: Add union_find_dir() Valerie Aurora
2011-03-23  1:59 ` [PATCH 30/74] union-mount: Create d_free_unions() Valerie Aurora
2011-03-23  1:59 ` [PATCH 31/74] union-mount: Free union stack on removal of topmost dentry from dcache Valerie Aurora
2011-03-23  1:59 ` [PATCH 32/74] union-mount: Create union_add_dir() Valerie Aurora
2011-03-23  1:59 ` [PATCH 33/74] union-mount: Add union_create_topmost_dir() Valerie Aurora
2011-03-23  1:59 ` [PATCH 34/74] union-mount: Create IS_MNT_UNION() Valerie Aurora
2011-03-23  1:59 ` [PATCH 35/74] union-mount: Create needs_lookup_union() Valerie Aurora
2011-03-23  1:59 ` [PATCH 36/74] union-mount: Create check_topmost_union_mnt() Valerie Aurora
2011-03-23  1:59 ` [PATCH 37/74] union-mount: Add clone_union_tree() and put_union_sb() Valerie Aurora
2011-03-23  1:59 ` [PATCH 38/74] union-mount: Create build_root_union() Valerie Aurora
2011-03-23  1:59 ` [PATCH 39/74] union-mount: Create prepare_mnt_union() and cleanup_mnt_union() Valerie Aurora
2011-03-23  1:59 ` [PATCH 40/74] union-mount: Prevent improper union-related remounts Valerie Aurora
2011-03-23  1:59 ` [PATCH 41/74] union-mount: Prevent topmost file system from being mounted elsewhere Valerie Aurora
2011-03-23  1:59 ` [PATCH 42/74] union-mount: Prevent bind mounts of union mounts Valerie Aurora
2011-03-23  1:59 ` [PATCH 43/74] union-mount: Implement union mount Valerie Aurora
2011-03-23  1:59 ` [PATCH 44/74] union-mount: Temporarily disable some syscalls Valerie Aurora
2011-03-23  2:12 ` [PATCH 00/74] Union mounts version something or other Valerie Aurora
2011-03-24 13:43   ` Union mounts comparison with overlay file system prototype? Ric Wheeler
2011-03-25 11:38     ` Szeredi Miklos
2011-03-25 12:12       ` Ric Wheeler
2011-03-23  8:38 ` [PATCH 00/74] Union mounts version something or other Sedat Dilek
2011-03-24 22:40   ` Ben Hutchings
2011-03-25  2:32     ` Sedat Dilek
2011-03-30 14:30 ` David Howells
2011-04-01 16:48   ` Valerie Aurora
2011-04-21 13:09   ` David Howells
2011-04-24 21:48     ` Valerie Aurora [this message]

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='BANLkTinS2XXD4atoGdun7kp=_XVE2RFgrg@mail.gmail.com' \
    --to=valerie.aurora@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).