Unionfs: don't open unhashed files
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 22:49:21 +0000 (18:49 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 19 Sep 2008 22:49:21 +0000 (18:49 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/commonfops.c

index 51f10a23d28fb956c492030dfc163d748e0de171..16b8b3caf94312021d599da2a008a62dbf20aa0b 100644 (file)
@@ -601,6 +601,15 @@ int unionfs_open(struct inode *inode, struct file *file)
                goto out_nofree;
        }
 
+#if 0
+#error this code is needed for 2.6.19 and newer, but breaks 2.6.18
+       /* don't open unhashed/deleted files */
+       if (d_deleted(dentry)) {
+               err = -ENOENT;
+               goto out_nofree;
+       }
+#endif
+
        file->private_data =
                kzalloc(sizeof(struct unionfs_file_info), GFP_KERNEL);
        if (unlikely(!UNIONFS_F(file))) {