Hi Al, Christoph, everyone, This patch series aims to make the VFS less paranoid about fs behavior when it comes to rmdir and dentry hashing. There are a few old/simple file systems that can't handle references to directories that are removed from the namespace (e.g. mkdir t ; cd t ; rmdir ../t). To keep them happy, the dentry_unhash() helper is called prior to rmdir and vfs_rename_dir (if the target is an existing directory) to unhash it, even though this is unnecessary for most of the file systems people actually use. The original idea was that a lazy fs can if (!d_unhashed(dir)) return -EBUSY; In reality, the most common file systems don't want/need this (and, in fact, I can't find any that actually do). This patch set cleans up the VFS behavior by removing _all_ unhashing behavior by pushing it down into the file systems, where it can either be left alone (to preserve old behavior) or removed. There is also a patch that strips out some useless (presumably historic) refcount twiddling in dentry_unhash. The VFS unhashing behavior already causes weird behavior with rename (currently masked by existing d_revalidate implementations in a very fragile way; see Miklos' patch, #7), and is one roadblock preventing ceph from managing the consistently of the dcache in a non-racy way. I included patches to remove the pushed-down calls from a few of the more commonly used file systems. I'm sure it can also be removed from others, but I'd prefer to defer to those maintainers' judgement. Al, Christoph, please let me know if this looks like a reasonable cleanup, and/or if there is anything you'd like to see before this (or something like it) can be merged. Thanks! sage Miklos Szeredi (1): vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems Sage Weil (17): vfs: dentry_unhash immediately prior to rmdir vfs: remove dget() from dentry_unhash() vfs: push dentry_unhash on rmdir into file systems vfs: push dentry_unhash on rename_dir into file systems vfs: update dentry_unhash() comment libfs: drop unneeded dentry_unhash ceph: remove unnecessary dentry_unhash calls xfs: remove unnecessary dentry_unhash from rmdir/rename_dir btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir ext4: remove unnecessary dentry_unhash on rmdir/rename_dir ext3: remove unnecessary dentry_unhash on rmdir/rename_dir ext2: remove unnecessary dentry_unhash on rmdir/rename_dir nfs: remove unnecessary dentry_unhash on rmdir/rename_dir exofs: remove unnecessary dentry_unhash on rmdir/rename_dir ocfs2: remove unnecessary dentry_unhash on rmdir/rename_dir gfs2: remove unnecessary dentry_unhash on rmdir/rename_dir cifs: remove unnecessary dentry_unhash on rmdir/rename_dir fs/9p/vfs_inode.c | 4 ++++ fs/affs/namei.c | 5 +++++ fs/afs/dir.c | 5 +++++ fs/autofs4/root.c | 2 ++ fs/bfs/dir.c | 3 +++ fs/coda/dir.c | 5 +++++ fs/configfs/dir.c | 2 ++ fs/ecryptfs/inode.c | 5 +++++ fs/fat/namei_msdos.c | 5 +++++ fs/fat/namei_vfat.c | 5 +++++ fs/fuse/dir.c | 6 ++++++ fs/hfs/dir.c | 6 ++++++ fs/hfsplus/dir.c | 8 ++++++-- fs/hostfs/hostfs_kern.c | 5 +++++ fs/hpfs/namei.c | 9 ++++++--- fs/jffs2/dir.c | 5 +++++ fs/jfs/namei.c | 5 +++++ fs/logfs/dir.c | 5 +++++ fs/minix/namei.c | 5 +++++ fs/namei.c | 21 ++++++--------------- fs/ncpfs/dir.c | 5 +++++ fs/nilfs2/namei.c | 5 +++++ fs/omfs/dir.c | 11 +++++++++-- fs/reiserfs/namei.c | 5 +++++ fs/reiserfs/xattr.c | 1 - fs/sysv/namei.c | 5 +++++ fs/ubifs/dir.c | 5 +++++ fs/udf/namei.c | 5 +++++ fs/ufs/namei.c | 5 +++++ 29 files changed, 140 insertions(+), 23 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html