| From: |
| David Howells <dhowells@redhat.com> |
| To: |
| linux-fsdevel@vger.kernel.org |
| Subject: |
| [RFC][PATCH 00/76] Union Mount |
| Date: |
| Fri, 17 Jun 2011 17:00:10 +0100 |
| Message-ID: |
| <20110617160008.30314.22757.stgit@warthog.procyon.org.uk> |
| Cc: |
| hch@infradead.org |
| Archive-link: |
| Article, Thread
|
Here are the unionmount patches brought up to date wrt RCU walk pathwalk and
other changes.
The whole stack builds at each patch point, apart from the last patch which
doesn't build yet.
There are some locking issues to be addressed:
(1) Lots of lockdep noise when the upper and lower fs's are of the same type.
I have a pair of patches to deal with that by making a second lock class
for i_mutex and i_dir_mutex in struct file_system_type and using the
second classes for the upper fs, but that precludes unionmounting over a
unionmount in future.
(2) do_union_copyup_len() generates lockdep noise because it gets a lock on
the parent dir's i_mutex that's the same level as the one vfs_setxattr()
wants to get on the i_mutex of the inode it is given.
(3) Unmounting the lower fs before the upper fs will cause a deadlock.
mount a /mnt
mount -o union b /mnt
mount --move /mnt /foo
umount /mnt
umount /foo
because umount_tree() then calls d_free_unions() whilst its parent holds
vfsmount_lock, but d_free_unions() calls mntput() which may also want that
lock. Cleanup should be deferred to release_mounts().
And some other issues:
(1) I need to work out what the last two (ext2) patches are doing and
integrate them.
(2) The RCU pathwalk needs checking over, in particular my handling of
sequence numbers.
(3) Need to handle automount points and managed directories.
(4) Need to better handle mountpoints. Currently it just calls
follow_mount(), which is probably wrong.
(5) do_lookup() needs to come up with the correct inode after
needs_lookup_union() is called.
(6) Should d_revalidate() be called on the lower fs objects under some
circumstances. I assume not, since we don't want to see the lower fs
changing.
David
---
David Howells (2):
union-mount: Duplicate the i_{,dir_}mutex lock classes and use for upper layer
union-mount: Pass mount flags to sget()
Felix Fietkau (2):
jffs2: Add fallthru support
jffs2: Add whiteout support
Jan Blunck (8):
union-mount: Create IS_MNT_UNION()
union-mount: Free union stack on removal of topmost dentry from dcache
union-mount: Introduce MNT_UNION and MS_UNION flags
tmpfs: Add whiteout support
whiteout: Allow removal of a directory with whiteouts
whiteout: Add vfs_whiteout() and whiteout inode operation
whiteout/NFSD: Don't return information about whiteouts to userspace
VFS: Make lookup_hash() return a struct path
Valerie Aurora (64):
Temporary commit
XXX - works but needs whiteout find entry removed
union-mount: Implement union-aware lsetxattr()
union-mount: Implement union-aware setxattr()
union-mount: Implement union-aware utimensat()
union-mount: Implement union-aware lchown()
union-mount: Implement union-aware chmod()/fchmodat()
union-mount: Implement union-aware truncate()
union-mount: Implement union-aware chown()
union-mount: Implement union-aware writable open()
union-mount: Implement union-aware rename()
union-mount: Implement union-aware link()
union-mount: Implement union-aware access()/faccessat()
union-mount: In-kernel file copyup routines
VFS: Create user_path_nd() to lookup both parent and target
VFS: Split inode_permission() and create path_permission()
fallthru: jffs2 support for lookup of d_type/d_ino in fallthrus
fallthru: tmpfs support for lookup of d_type/d_ino in fallthrus
fallthru: ext2 support for lookup of d_type/d_ino in fallthrus
union-mount: Add generic_readdir_fallthru() helper
union-mount: Copy up directory entries on first readdir()
union-mount: Set opaque flag on new directories in unioned file systems
union-mount: Create whiteout on rmdir()
union-mount: Create whiteout on unlink()
union-mount: Call union lookup functions in lookup path
union-mount: Add do_lookup_union() wrapper for __lookup_union()
union-mount: Add lookup_union()
union-mount: Follow mount in __lookup_union()
union-mount: Build union stack in __lookup_union()
union-mount: Return files found in lower layers in __lookup_union()
union-mount: Process negative dentries in __lookup_union()
union-mount: Basic infrastructure of __lookup_union()
union-mount: Temporarily disable some syscalls
union-mount: Implement union mount
union-mount: Prevent bind mounts of union mounts
union-mount: Prevent topmost file system from being mounted elsewhere
union-mount: Prevent improper union-related remounts
union-mount: Create prepare_mnt_union() and cleanup_mnt_union()
union-mount: Create build_root_union()
union-mount: Add clone_union_tree() and put_union_sb()
union-mount: Create check_topmost_union_mnt()
union-mount: Create needs_lookup_union()
union-mount: Add union_create_topmost_dir()
union-mount: Create union_add_dir()
union-mount: Create d_free_unions()
union-mount: Add union_find_dir()
union-mount: Add union_alloc()
union-mount: Add two superblock fields for union mounts
union-mount: Create union_stack structure
union-mount: Add CONFIG_UNION_MOUNT option
union-mount: Union mounts documentation
tmpfs: Add fallthru support
ext2: Add fallthru support
VFS: Basic fallthru definitions
ext2: Add whiteout support
ext2: Split ext2_add_entry() from ext2_add_link()
ext2: Add ext2_dirent_in_use()
whiteout: Define flags and operations for opaque inodes
VFS: Comment follow_mount() and friends
VFS: Add CL_MAKE_HARD_READONLY flag to clone_mnt()/copy_tree()
VFS: Add CL_NO_SLAVE flag to clone_mnt()/copy_tree()
VFS: Add CL_NO_SHARED flag to clone_mnt()/copy_tree()
VFS: Add hard read-only users count to superblock
VFS: Make clone_mnt()/copy_tree()/collect_mounts() return errors
Documentation/filesystems/union-mounts.txt | 712 ++++++++++++++++++++++
Documentation/filesystems/vfs.txt | 16
drivers/mtd/mtdsuper.c | 4
fs/9p/vfs_super.c | 4
fs/Kconfig | 12
fs/Makefile | 1
fs/afs/super.c | 3
fs/btrfs/super.c | 4
fs/ceph/super.c | 2
fs/cifs/cifsfs.c | 8
fs/compat.c | 9
fs/dcache.c | 29 +
fs/devpts/inode.c | 6
fs/ecryptfs/main.c | 3
fs/ext2/dir.c | 146 ++++
fs/ext2/ext2.h | 3
fs/ext2/inode.c | 11
fs/ext2/namei.c | 77 ++
fs/ext2/super.c | 6
fs/gfs2/ops_fstype.c | 5
fs/inode.c | 48 +
fs/jffs2/dir.c | 117 +++-
fs/jffs2/fs.c | 4
fs/jffs2/super.c | 2
fs/libfs.c | 25 +
fs/logfs/super.c | 3
fs/namei.c | 921 +++++++++++++++++++++++++---
fs/namespace.c | 385 ++++++++++--
fs/nfs/super.c | 10
fs/nfsd/nfs3xdr.c | 5
fs/nfsd/nfs4xdr.c | 5
fs/nfsd/nfsxdr.c | 4
fs/nilfs2/super.c | 4
fs/open.c | 116 +++-
fs/pnode.c | 5
fs/pnode.h | 3
fs/proc/root.c | 3
fs/readdir.c | 18 +
fs/reiserfs/procfs.c | 2
fs/super.c | 42 +
fs/sysfs/mount.c | 3
fs/ubifs/super.c | 3
fs/union.c | 685 +++++++++++++++++++++
fs/union.h | 107 +++
fs/utimes.c | 14
fs/xattr.c | 65 ++
include/linux/dcache.h | 39 +
include/linux/ext2_fs.h | 8
include/linux/fs.h | 51 +-
include/linux/jffs2.h | 8
include/linux/mount.h | 4
include/linux/namei.h | 2
kernel/audit_tree.c | 10
kernel/cgroup.c | 2
mm/shmem.c | 192 +++++-
55 files changed, 3679 insertions(+), 297 deletions(-)
create mode 100644 Documentation/filesystems/union-mounts.txt
create mode 100644 fs/union.c
create mode 100644 fs/union.h
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html