linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Valerie Aurora <vaurora@redhat.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: viro@zeniv.linux.org.uk, hch@infradead.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/6] Union mount core rewrite v1
Date: Wed, 3 Mar 2010 15:31:50 -0500	[thread overview]
Message-ID: <20100303203150.GB19689@shell> (raw)
In-Reply-To: <E1NmsNN-0003s9-P1@pomaz-ex.szeredi.hu>

On Wed, Mar 03, 2010 at 06:28:49PM +0100, Miklos Szeredi wrote:
> On Tue,  2 Mar 2010, Valerie Aurora wrote:
> > This is a major rewrite of parts of union mounts, in particular the
> > pathname lookup code.  For more info about union mounts, see:
> > 
> > http://valerieaurora.org/union/
> > 
> > The previous code had two important problems fixed in this series:
> > 
> > - On file open, is_unionized() grabs vfsmount lock and walks up the
> >   mount tree even for non-union mounts.
> > 
> > - Pathname lookup required three cut-n-pasted versions of two complex
> >   functions, one for each of cached/real/"hashed" lookups.
> 
> Looks much better :)

Thanks for the review. :)

> > This rewrite reduces the additional cost of a non-union lookup in a
> > CONFIG_UNION_MOUNT kernel to either 1 or 2 mount flag tests (but adds
> > the requirement that file systems be unioned only at their root
> > directories).  This rewrite implements lookup with one lookup_union()
> > function for all types of lookups.
> > 
> > This posted patch series includes only the union lookup, mount, and
> > readdir patches and not the relatively uncontroversial whiteout and
> > fallthru code.
> 
> Special inode/dentry flags (whiteout, fallthrough, opaque) are not
> trivially the right solution:
> 
>  - they are invisible from userspace, new APIs are necessary to manipulate them
>  - they are difficult to support on network filesystems
>  - they are not useful for anything other than union mounts/filesystems
> 
> Extended attributes are a more standard way to add such info to files.
> Hard links would allow sharing a single inode for all whiteout entries
> and one for all fallthrough entries.
> 
> Have these options been considered as an alternative?

Thanks for bringing that up!  We have considered them and aren't sure
what the best solution is - all the options, including our current
example implementations, have serious drawbacks.  Fortunately, the
implementation of whiteouts, etc. is fairly separate from the main
body of union mount code.  For example, I'm pretty sure you could
implement whiteouts, fallthrus, and opaque flags in ext2 as system
extended attributes or as hard links (or as crazy special symlinks)
without changing any other non-ext2 patches.  We already switched once
from encoding whiteouts with reserved inode numbers in ext3 to
whiteouts as a new dentry type flag in ext2 and that didn't affect
other patches.  In general, I am happy with whatever the maintainer of
the underlying file system prefers.

The advantage of the system extended attribute approach is that any
file system with xattrs also supports union mounts.  It might be worth
implementing for that reason alone.

-VAL

      reply	other threads:[~2010-03-03 20:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 22:11 [RFC PATCH 0/6] Union mount core rewrite v1 Valerie Aurora
2010-03-02 22:11 ` [PATCH 1/6] union-mount: Introduce union_mount structure and basic operations Valerie Aurora
2010-03-02 22:11   ` [PATCH 2/6] union-mount: Drive the union cache via dcache Valerie Aurora
2010-03-02 22:11     ` [PATCH 3/6] union-mount: Implement union lookup Valerie Aurora
2010-03-02 22:11       ` [PATCH 4/6] union-mount: Support for mounting union mount file systems Valerie Aurora
2010-03-02 22:11         ` [PATCH 5/6] union-mount: Call do_whiteout() on unlink and rmdir in unions Valerie Aurora
2010-03-02 22:11           ` [PATCH 6/6] union-mount: Copy up directory entries on first readdir() Valerie Aurora
2010-03-03 21:53             ` Multiple read-only layers in union mounts (was Re: [PATCH 6/6] union-mount: Copy up directory entries on first readdir()) Valerie Aurora
2010-03-03 17:35     ` [PATCH 2/6] union-mount: Drive the union cache via dcache Miklos Szeredi
2010-03-03 21:49       ` Valerie Aurora
2010-03-04 16:34         ` Miklos Szeredi
2010-03-09 19:22           ` Valerie Aurora
2010-03-03 17:33   ` [PATCH 1/6] union-mount: Introduce union_mount structure and basic operations Miklos Szeredi
2010-03-03 20:45     ` Valerie Aurora
2010-03-04 16:24       ` Miklos Szeredi
2010-03-09 19:49         ` Valerie Aurora
2010-03-03 17:28 ` [RFC PATCH 0/6] Union mount core rewrite v1 Miklos Szeredi
2010-03-03 20:31   ` 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=20100303203150.GB19689@shell \
    --to=vaurora@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --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).