On Fri, 7 Aug 2009, OGAWA Hirofumi wrote: > akpm@xxxxxxxxxxxxxxxxxxxx writes: > > > diff -puN fs/namei.c~vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems fs/namei.c > > --- a/fs/namei.c~vfs-fix-vfs_rename_dir-for-fs_rename_does_d_move-filesystems > > +++ a/fs/namei.c > > @@ -2595,8 +2595,6 @@ static int vfs_rename_dir(struct inode * > > if (!error) > > target->i_flags |= S_DEAD; > > mutex_unlock(&target->i_mutex); > > - if (d_unhashed(new_dentry)) > > - d_rehash(new_dentry); > > dput(new_dentry); > > } > > if (!error) > > It breaks the error handling? > > I.e. > > if (target) { > mutex_lock(&target->i_mutex); > dentry_unhash(new_dentry); <= unhash > } > if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) > error = -EBUSY; <= error > else > error = old_dir->i_op->rename(); <= or return error > if (target) { > if (!error) > target->i_flags |= S_DEAD; > mutex_unlock(&target->i_mutex); > <= doesn't rehash > dput(new_dentry); > } FWIW, the originally proposed fix only rehashed on error, but Miklos was worried the rehash (under any circumstances) looked racy and/or bogus. And Al was just worried. See http://marc.info/?t=121580579500004&r=1&w=2 and http://marc.info/?t=121664078900004&r=1&w=2 The last word from Al (about this time last year :) was On Thu, 21 Aug 2008, Al Viro wrote: > I'm still not convinced that this is right. Let me finish review of the > current situation with dcache and rehashing, please. We definitely have > problems in that area; the question is how to deal with all that crap > without breaking exportfs *and* secondary roots a-la NFS ;-/ sage -- 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