From c1a8887d81590ff113be93e0e37ba4a6c826aa92 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 30 Mar 2012 14:04:16 -0400 Subject: [PATCH] --- yaml --- r: 298371 b: refs/heads/master c: 3f6c7c71a2af6eb306e16562c6ee1bfdb48015fb h: refs/heads/master i: 298369: 328d0dead226bf5d75f4bf1c49bbe4a6cc5425a6 298367: 82e8cc85497ba395c7e5dc47a739cad9e4ecffc3 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index b725462c62b2..0bbfe4331860 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cda309de253f338b04d15b4478e45fc3a0fcc7a3 +refs/heads/master: 3f6c7c71a2af6eb306e16562c6ee1bfdb48015fb diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 907e24785576..157f3debbf98 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1194,6 +1194,21 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, status = 1; } mutex_unlock(&dir->i_mutex); + if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) + status = d_revalidate(dentry, nd); + if (unlikely(status <= 0)) { + if (status < 0) { + dput(dentry); + return status; + } + if (!d_invalidate(dentry)) { + dput(dentry); + dentry = NULL; + need_reval = 1; + goto retry; + } + } + goto done; } if (unlikely(dentry->d_flags & DCACHE_OP_REVALIDATE) && need_reval) status = d_revalidate(dentry, nd); @@ -1209,7 +1224,7 @@ static int do_lookup(struct nameidata *nd, struct qstr *name, goto retry; } } - +done: path->mnt = mnt; path->dentry = dentry; err = follow_managed(path, nd->flags);