Unionfs: properly hash newly created inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Mon, 28 Jul 2008 02:47:14 +0000 (22:47 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Mon, 28 Jul 2008 02:47:14 +0000 (22:47 -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 d9ca249c790bbf849df1789f0de3f088ac0c26c4..0173e27d56a1f12abc0c9afc6a2e6988ce285473 100644 (file)
@@ -330,7 +330,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;