From: Al Viro Date: Fri, 30 Mar 2012 18:04:16 +0000 (-0400) Subject: untangling do_lookup() - isolate !dentry stuff from the rest of it. X-Git-Tag: v3.4-rc1~2^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f6c7c71a2af6eb306e16562c6ee1bfdb48015fb;p=platform%2Fkernel%2Flinux-exynos.git untangling do_lookup() - isolate !dentry stuff from the rest of it. Duplicate the revalidation-related parts into if (!dentry) branch. Next step will be to pull them under i_mutex. This and the next 8 commits are more or less a splitup of patch by Miklos; folks, when you are working with something that convoluted, carve your patches up into easily reviewed steps, especially when a lot of codepaths involved are rarely hit... Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index 907e247..157f3de 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1194,6 +1194,21 @@ retry: 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 @@ retry: goto retry; } } - +done: path->mnt = mnt; path->dentry = dentry; err = follow_managed(path, nd->flags);