Commit 1fa1e384 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

NFS: teach nfs_lookup_verify_inode to handle LOOKUP_RCU

It fails with -ECHILD rather than make an RPC call.

This allows nfs_lookup_revalidate to call it in RCU-walk mode.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 912a108d
......@@ -1050,6 +1050,8 @@ int nfs_lookup_verify_inode(struct inode *inode, unsigned int flags)
out:
return (inode->i_nlink == 0) ? -ENOENT : 0;
out_force:
if (flags & LOOKUP_RCU)
return -ECHILD;
ret = __nfs_revalidate_inode(server, inode);
if (ret != 0)
return ret;
......@@ -1135,11 +1137,11 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
if (!nfs_is_exclusive_create(dir, flags) &&
nfs_check_verifier(dir, dentry, flags & LOOKUP_RCU)) {
if (flags & LOOKUP_RCU)
return -ECHILD;
if (nfs_lookup_verify_inode(inode, flags))
if (nfs_lookup_verify_inode(inode, flags)) {
if (flags & LOOKUP_RCU)
return -ECHILD;
goto out_zap_parent;
}
goto out_valid;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment