* aliased directories, was Re: 2.6.8.1-mm2
[not found] <20040819014204.2d412e9b.akpm@osdl.org>
@ 2004-08-19 9:39 ` Christoph Hellwig
2004-08-19 9:43 ` 2.6.8.1-mm2 Christoph Hellwig
1 sibling, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2004-08-19 9:39 UTC (permalink / raw)
To: Andrew Morton, viro, reiser; +Cc: linux-fsdevel
> +reiser4-aliased-dir.patch
Looks like we're getting hardlinks on directories through the backdoor now.
Hans, are you volunteering to audit the VFS for all the other assumptions?
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 Wed Aug 18 16:42:44 2004
+++ 25-akpm/fs/namei.c Wed Aug 18 16:42:44 2004
@@ -1169,7 +1169,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;
}
@@ -1200,7 +1200,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);
}
_
^ permalink raw reply [flat|nested] 2+ messages in thread