From 899b963bef096b9bd834e81018e65d1570329063 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Thu, 18 Sep 2008 23:00:23 -0400 Subject: [PATCH] Unionfs: don't open unhashed files Signed-off-by: Erez Zadok --- fs/unionfs/commonfops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c index 51f10a23d28..7711f93acf5 100644 --- a/fs/unionfs/commonfops.c +++ b/fs/unionfs/commonfops.c @@ -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))) { -- 2.43.0