Unionfs: don't leak an inode in hardlinks
authorErez Zadok <ezk@cs.sunysb.edu>
Wed, 23 Sep 2009 05:26:13 +0000 (01:26 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 23 Sep 2009 05:26:13 +0000 (01:26 -0400)
Set the hardlink'ed inode to the same one as the linked one, instead of
instantiating a new inode.

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

index 118e2c83883d169724e93a328f375be850b74ca7..eaac15527a6ae734e0872da81001962a85433c55 100644 (file)
@@ -318,7 +318,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);