Unionfs: properly hash newly created inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 29 Jul 2008 22:07:44 +0000 (18:07 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 29 Jul 2008 22:07:44 +0000 (18:07 -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 c58f6597d31920179f0efc18cacc5b88819819f8..ee59abf3a44b994c92be067dd8f0826e8e928fd6 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 dbfe28f362f8a8df5630d0ce2ac58134b2c75189..1cfdd832eb0ed4bbf271d69557b6bf94a4a7abc7 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;