diff options
author | NeilBrown <neilb@suse.de> | 2014-07-14 11:28:20 +1000 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-03 17:14:13 -0400 |
commit | 1fa1e38447964d6c96b027f9f999ef105d8cf8aa (patch) | |
tree | b992f859e384cddb2bfb933fd466b537e282a5a7 /fs/nfs | |
parent | 912a108da767ae75cc929d2854e698aff527ec5d (diff) | |
download | blackbird-op-linux-1fa1e38447964d6c96b027f9f999ef105d8cf8aa.tar.gz blackbird-op-linux-1fa1e38447964d6c96b027f9f999ef105d8cf8aa.zip |
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: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index dcd4fe5831d6..2bfbde0f7176 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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; } |