linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] clean up VFS dentry_hash (mis)behavior
@ 2011-05-10  4:43 Sage Weil
  2011-05-10  4:43 ` [PATCH 01/18] vfs: dentry_unhash immediately prior to rmdir Sage Weil
                   ` (18 more replies)
  0 siblings, 19 replies; 26+ messages in thread
From: Sage Weil @ 2011-05-10  4:43 UTC (permalink / raw)
  To: viro, hch, linux-fsdevel; +Cc: Sage Weil

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(-)


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-05-11 17:17 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-10  4:43 [PATCH 00/18] clean up VFS dentry_hash (mis)behavior Sage Weil
2011-05-10  4:43 ` [PATCH 01/18] vfs: dentry_unhash immediately prior to rmdir Sage Weil
2011-05-10  8:12   ` Christoph Hellwig
2011-05-10  4:43 ` [PATCH 02/18] vfs: remove dget() from dentry_unhash() Sage Weil
2011-05-10  4:43 ` [PATCH 03/18] vfs: push dentry_unhash on rmdir into file systems Sage Weil
2011-05-10  4:43 ` [PATCH 04/18] vfs: push dentry_unhash on rename_dir " Sage Weil
2011-05-10  4:43 ` [PATCH 05/18] vfs: update dentry_unhash() comment Sage Weil
2011-05-10  4:43 ` [PATCH 06/18] libfs: drop unneeded dentry_unhash Sage Weil
2011-05-10  4:43 ` [PATCH 07/18] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems Sage Weil
2011-05-10  4:43 ` [PATCH 08/18] ceph: remove unnecessary dentry_unhash calls Sage Weil
2011-05-10  4:43 ` [PATCH 09/18] xfs: remove unnecessary dentry_unhash from rmdir/rename_dir Sage Weil
2011-05-10  4:43 ` [PATCH 10/18] btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir Sage Weil
2011-05-10  4:43 ` [PATCH 11/18] ext4: remove unnecessary dentry_unhash on rmdir/rename_dir Sage Weil
2011-05-10  4:43 ` [PATCH 12/18] ext3: " Sage Weil
2011-05-10  4:43 ` [PATCH 13/18] ext2: " Sage Weil
     [not found] ` <1305002616-16782-1-git-send-email-sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
2011-05-10  4:43   ` [PATCH 14/18] nfs: " Sage Weil
2011-05-10  4:43 ` [PATCH 15/18] exofs: " Sage Weil
2011-05-11 12:53   ` Boaz Harrosh
2011-05-10  4:43 ` [PATCH 16/18] ocfs2: " Sage Weil
2011-05-10 20:24   ` Joel Becker
2011-05-10  4:43 ` [PATCH 17/18] gfs2: " Sage Weil
2011-05-10  8:45   ` Steven Whitehouse
2011-05-10 15:47     ` Sage Weil
2011-05-10  4:43 ` [PATCH 18/18] cifs: " Sage Weil
2011-05-11 10:06 ` [PATCH 00/18] clean up VFS dentry_hash (mis)behavior Christoph Hellwig
2011-05-11 17:18   ` Sage Weil

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).