Unionfs: properly hash newly created inodes
authorErez Zadok <ezk@cs.sunysb.edu>
Mon, 28 Jul 2008 04:25:46 +0000 (00:25 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 29 Apr 2011 02:26:25 +0000 (22:26 -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 fa3c51868fed27133cdf6097a5e91738da53fcc7..a05b412aa1d0de7bd03f04ec0f87218018eb01ea 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 0cdd50b788443028982edcbfda91eb372e747d46..fea670b873c099a5a012415dd44bf14702286f87 100644 (file)
@@ -128,6 +128,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;