vfs: don't revalidate just looked up dentry
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 26 Mar 2012 10:54:20 +0000 (12:54 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 31 Mar 2012 20:03:16 +0000 (16:03 -0400)
__lookup_hash() calls ->lookup() if the dentry needs lookup and on success
revalidates the dentry (all under dir->i_mutex).

While this is harmless it doesn't make a lot of sense.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 768f2366bdddd5c290a559e26f54ce64c5fb5376..82f9568d315d1f5b1c87d69fce2a4446cc193455 100644 (file)
@@ -1869,9 +1869,7 @@ static struct dentry *__lookup_hash(struct qstr *name,
                 * __lookup_hash is called with the parent dir's i_mutex already
                 * held, so we are good to go here.
                 */
-               dentry = d_inode_lookup(base, dentry, nd);
-               if (IS_ERR(dentry))
-                       return dentry;
+               return d_inode_lookup(base, dentry, nd);
        }
 
        if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) {