
From: Hans Reiser <reiser@namesys.com>

Reiser4 pseudo files exist within regular files also.  For example,
"/etc/passwd/..uid" is a valid path.  This introduces situation impossible in
the traditional UNIX file system: non-leaf object in file system name-space
tree ("/etc/passwd"), may have more than one name (nlink > 1).  But in normal
UNIX file system all non-leaf objects are directories, and directories cannot
have multiple names.  Specifically, directory can have only one dentry. 
During rename(2) this is used to check whether file is renamed within the same
directory and moved to another one.  This check doesn't work in reiser4 as is.
 Fix it.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/namei.c~reiser4-aliased-dir fs/namei.c
--- 25/fs/namei.c~reiser4-aliased-dir	2004-10-24 03:50:40.984903976 -0700
+++ 25-akpm/fs/namei.c	2004-10-24 03:50:40.988903368 -0700
@@ -1186,7 +1186,7 @@ struct dentry *lock_rename(struct dentry
 {
 	struct dentry *p;
 
-	if (p1 == p2) {
+	if (p1->d_inode == p2->d_inode) {
 		down(&p1->d_inode->i_sem);
 		return NULL;
 	}
@@ -1217,7 +1217,7 @@ struct dentry *lock_rename(struct dentry
 void unlock_rename(struct dentry *p1, struct dentry *p2)
 {
 	up(&p1->d_inode->i_sem);
-	if (p1 != p2) {
+	if (p1->d_inode != p2->d_inode) {
 		up(&p2->d_inode->i_sem);
 		up(&p1->d_inode->i_sb->s_vfs_rename_sem);
 	}
_
