From: Erez Zadok Date: Tue, 12 Aug 2014 02:39:55 +0000 (-0400) Subject: Unionfs: fix d_revalidate for corner case X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=7bf0ea5858615d74e47d743e4e772a4515c08006;p=unionfs-2.6.22.y.git 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 --- diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c index 471c4e7a88c..0d5dd984283 100644 --- a/fs/unionfs/dentry.c +++ b/fs/unionfs/dentry.c @@ -308,6 +308,11 @@ static int unionfs_d_revalidate(struct dentry *dentry, parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT); unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD); + if (!unionfs_lower_dentry(dentry)) { + err = 0; + goto out; + } + valid = __unionfs_d_revalidate(dentry, parent, false); if (valid) { unionfs_postcopyup_setmnt(dentry); @@ -316,6 +321,7 @@ static int unionfs_d_revalidate(struct dentry *dentry, d_drop(dentry); err = valid; } +out: unionfs_unlock_dentry(dentry); unionfs_unlock_parent(dentry, parent); unionfs_read_unlock(dentry->d_sb);