Unionfs: don't open unhashed files
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 26 Aug 2008 19:07:49 +0000 (15:07 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 12 Aug 2011 02:38:40 +0000 (22:38 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c

index 51f10a23d28fb956c492030dfc163d748e0de171..7711f93acf5e5de044bd3b36ebaaf3846c1ea134 100644 (file)
@@ -601,6 +601,12 @@ int unionfs_open(struct inode *inode, struct file *file)
                goto out_nofree;
        }
 
+       /* don't open unhashed/deleted files */
+       if (d_deleted(dentry)) {
+               err = -ENOENT;
+               goto out_nofree;
+       }
+
        file->private_data =
                kzalloc(sizeof(struct unionfs_file_info), GFP_KERNEL);
        if (unlikely(!UNIONFS_F(file))) {