From 684d9ab043e411e027c8e02a0a7e883ceec11f06 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Sun, 10 Aug 2014 02:00:35 -0400 Subject: [PATCH] Unionfs: fix d_revalidate for corner case In some cases, lower_dentry may goes to NULL. Return 0 here to mark it as invalid dentry. Signed-off-by: Erez Zadok Signed-off-by: Mengyang Li --- fs/unionfs/dentry.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c index a10c4fdb40da..318b3d53e67a 100644 --- a/fs/unionfs/dentry.c +++ b/fs/unionfs/dentry.c @@ -312,6 +312,10 @@ static int unionfs_d_revalidate(struct dentry *dentry, unsigned int flags) unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD); lower_dentry = unionfs_lower_dentry(dentry); + if (!lower_dentry) { + err = 0; + goto out; + } if (!(lower_dentry->d_flags & DCACHE_OP_REVALIDATE)) goto out; -- 2.34.1