Heads up on VFS based union mount



The need for a unified/merged view of two or more filesystems/directories
has been felt for sometime now. Though a few out-of-the-kernel solutions
existed for this, it is only recently that the unionfs(1) solution has gone
into -mm. At the time of merging unionfs into -mm, a few questions were
raised about the appropriateness of having this namespace unification
feature as a separate stackable file system. Encouraged by this comment
from Andrew (http://lkml.org/lkml/2007/1/8/280) and also the interest about
unionfs in recently concluded Linux Storage and Filesystem Workshop(2),
I started looking into Jan Blunck's 2004 diploma thesis work where he had
implemented a VFS based union mount feature. Now Jan and I are working
towards moving this to latest kernel and bringing it to a stage that it
can posted as an RFC. While we are at it, we thought lets give a heads up
on our union mount effort and try to get some early feedbacks/opinions.

While unionfs implements a new filesystem and maintains a set
of VFS objects which stack the real VFS objects under them to get the
unification feature, union mount achieves the same stacking with
minimal (atleast conceptually minimal) changes at the VFS layer.

In union mount approach we maintain this stacking information in the
dentry structure. When a filesytem is union mounted on a mountpoint,
the dentry of the mount root would hold a reference to the mountpoint
dentry as an overlaid dentry and these two dentries together form
a union stack. Any subsequent readdir operation on this union mounted
dentry would work on the overlaid dentry also thereby providing the
merged view of the two filesystems.

Since the stacking information is maintained at the VFS layer, union
mount makes some heavy changes to the VFS lookup code and minor changes
to many VFS routines. Also the whiteout filetype is handled in kernel
and the physical filesytem is expected to support the new whiteout file type.
For copyup, we are right now using a hack of pipe/splice to get the
in-kernel file copy between two layers.

We are planning to post the RFC code pretty soon. More documentation
about the approach would accompany the code.

(1) Unionfs: http://www.filesystems.org/project-unionfs.html
(2) LWN article on LSF07: http://lwn.net/Articles/226351/

Regards,
Bharata.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [RFC][PATCH] VFS: update documentation (take #2)
    ... > filesystem interface to userspace programs. ... > abstraction within the kernel which allows different filesystem ... > a pointer to the dentry and a set of file operation member functions. ... called when the VFS needs to get filesystem statistics. ...
    (Linux-Kernel)
  • [PATCH 1/2] VFS: update overview document
    ... -The Virtual File System (otherwise known as the Virtual Filesystem ... The pathname argument is used by the VFS to search through the ... -directory entry cache (dentry cache or "dcache"). ... -An individual dentry usually has a pointer to an inode. ...
    (Linux-Kernel)
  • Re: [patch] epoll use a single inode ...
    ... Delay the dentry name generation on sockets and pipes. ... Introduces a new method in 'struct dentry_operations'. ... Dentries and the dcache are the domain of the VFS and the ... individual filesystem implementations. ...
    (Linux-Kernel)
  • [PATCH] VFS: update documentation
    ... The Virtual File System (otherwise known as the Virtual Filesystem ... Switch) is the software layer in the kernel that provides the ... The VFS implements the open, stat, chmodand similar system ... struct file_system_type { ...
    (Linux-Kernel)
  • Re: [PATCH] VFS: update documentation
    ... The Virtual File System (otherwise known as the Virtual Filesystem ... Switch) is the software layer in the kernel that provides the ... The VFS implements the open, stat, chmodand similar system ... struct file_system_type { ...
    (Linux-Kernel)