From: Al Viro Date: Sun, 6 Mar 2016 03:37:46 +0000 (-0500) Subject: namei: simplify invalidation logics in lookup_dcache() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=74ff0ffc7f0682cb4c00252807d76116b95ecb9e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git namei: simplify invalidation logics in lookup_dcache() Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index fc6c5458b5ae..955e886c8e2a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1458,14 +1458,10 @@ static struct dentry *lookup_dcache(struct qstr *name, struct dentry *dir, if (dentry->d_flags & DCACHE_OP_REVALIDATE) { error = d_revalidate(dentry, flags); if (unlikely(error <= 0)) { - if (error < 0) { - dput(dentry); - return ERR_PTR(error); - } else { + if (!error) d_invalidate(dentry); - dput(dentry); - dentry = NULL; - } + dput(dentry); + return ERR_PTR(error); } } }