Unionfs: properly hash newly created inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 27 Jul 2008 19:51:47 +0000 (15:51 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 27 Jul 2008 19:51:47 +0000 (15:51 -0400)
This fixes LTP's syscalls/rename13 test.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/inode.c
fs/unionfs/main.c

index 4b594136954630d5c9e4c66ccbbc603219b6a3a9..0bb7523be0c0a5905cd29da948204024fa3c4efc 100644 (file)
@@ -339,7 +339,7 @@ check_link:
 
        /* Its a hard link, so use the same inode */
        new_dentry->d_inode = igrab(old_dentry->d_inode);
-       d_instantiate(new_dentry, new_dentry->d_inode);
+       d_add(new_dentry, new_dentry->d_inode);
        unionfs_copy_attr_all(dir, lower_new_dentry->d_parent->d_inode);
        fsstack_copy_inode_size(dir, lower_new_dentry->d_parent->d_inode);
 
index 12fd13e4d73b2f6af723d58acf08726c10f9d9c2..995875c43254172625f12446704c0790c6bd37c9 100644 (file)
@@ -129,6 +129,9 @@ skip:
        /* only (our) lookup wants to do a d_add */
        switch (flag) {
        case INTERPOSE_DEFAULT:
+               /* for operations which create new inodes */
+               d_add(dentry, inode);
+               break;
        case INTERPOSE_REVAL_NEG:
                d_instantiate(dentry, inode);
                break;