Unionfs: properly hash newly created inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 27 Jul 2008 22:49:13 +0000 (18:49 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 27 Jul 2008 22:49:13 +0000 (18:49 -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 d568fa83c03827d50ef1917082a6729097b20594..3bc9d7eb62242b22ef57ba7a0042063f7492af9d 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;