NFS: If the VFS sets LOOKUP_REVAL then force a lookup of the dentry
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 10 May 2018 14:13:09 +0000 (10:13 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 28 May 2018 17:29:19 +0000 (13:29 -0400)
If nfs_lookup_revalidate() is called with LOOKUP_REVAL because a
previous path lookup failed, then we ought to force a full lookup
of the component name.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/dir.c

index 4a73bd8b451723c32a4a2bf1188a1a69e7653302..9dde88334c9c48271b52ef57e8f34fe43c42d2d9 100644 (file)
@@ -1118,7 +1118,7 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
                goto out_set_verifier;
 
        /* Force a full look up iff the parent directory has changed */
-       if (!nfs_is_exclusive_create(dir, flags) &&
+       if (!(flags & (LOOKUP_EXCL | LOOKUP_REVAL)) &&
            nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU)) {
                error = nfs_lookup_verify_inode(inode, flags);
                if (error) {