lkml.org 
[lkml]   [2010]   [Jan]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 20/41] union-mount: Introduce union_mount structure
On Mon, Nov 30, 2009 at 03:46:29AM -0500, Erez Zadok wrote:
> In message <1256152779-10054-21-git-send-email-vaurora@redhat.com>, Valerie Aurora writes:
> > From: Jan Blunck <jblunck@suse.de>
> >
> > This patch adds the basic structures of VFS based union mounts. It is a new
> > implementation based on some of my old ideas that influenced Bharata B Rao
> > <bharata@linux.vnet.ibm.com> who came up with the proposal to let the
> > union_mount struct only point to the next layer in the union stack. I rewrote
> > nearly all of the central patches around lookup and the dcache interaction.
> >
> > Advantages of the new implementation:
> > - the new union stack is no longer tied directly to one dentry
> > - the union stack enables dentries to be part of more than one union
> > (bind mounts)
> > - it is unnecessary to traverse the union stack when de/referencing a dentry
> > - caching of union stack information still driven by dentry cache
> >
> > XXX - is_unionized() is pretty heavy-weight for non-union file systems
> > on a union mount-enabled kernel. May be simplified by assuming one or
> > more of:
> >
> > - Two layers only
> > - One-to-one association between layers (doesn't union submounts)
> > - Writable layer mounted in only one place
>
> Yes, is_unionized() does appear to be heavy. Is it correct to assume that
> every such dentry will have gotten looked up or traversed as part of a
> union? If so, can we just set a flag in the dentry to mark it as
> D_THIS_IS_PART_OF_A_UNION? Even if you could, what happens when a union r-w
> layer is removed: could there be leftover dentries marked as part of a
> union, which are no longer really part of it?

dentries aren't themselves part of a unioned file system - they are
shared among all the mounts of a superblock/device. A dentry is
unioned or not only in the context of a particular mount. So we can't
mark the dentry itself since it will be unioned in one mount (say,
/mnt/union) and not in another (/mnt/ro). A dentry can be looked up
in another mount of one of the components of the union before the
union mount is created, so we can't mark a dentry at lookup anyway.

The vfsmount for the top layer <dentry,mnt> pair is marked with
MNT_UNION, but the vfsmount for the bottom layer is not. I think we
could mark the lower vfsmount with a flag (probably not MNT_UNION but
MNT_UNION_LOWER or something like that) and check for that. Al? Jan?
Christoph?

-VAL


\
 
 \ /
  Last update: 2010-01-26 23:41    [W:0.143 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site