Re: [PATCH] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <sage@...>
Cc: <linux-fsdevel@...>, <viro@...>, <akpm@...>, <hch@...>
Date: Friday, July 11, 2008 - 4:53 pm

On Fri, 11 Jul 2008, Sage Weil wrote:

I think rehashing the new dentry is bogus, even on error.  And it
looks racy with lookup as well.

I wonder what the original reason for that was?  Git history doesn't
tell...

So a better fix would be just to remove the rehashing completely.
Does the below patch work for you?

Thanks,
Miklos

---
 fs/namei.c |    2 --
 1 file changed, 2 deletions(-)

Index: linux-2.6/fs/namei.c
===================================================================
--- linux-2.6.orig/fs/namei.c	2008-07-11 22:09:32.000000000 +0200
+++ linux-2.6/fs/namei.c	2008-07-11 22:40:16.000000000 +0200
@@ -2643,8 +2643,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)
--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOV..., Miklos Szeredi, (Fri Jul 11, 4:53 pm)