From 7ec9ae47295d00d3f91afa8596c79abf13346966 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Tue, 26 Aug 2008 15:07:49 -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.34.1