diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-12-16 18:04:47 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-12-19 17:29:37 -0500 |
commit | 9cdd1d3f1a8cea9cfe7953f45fae9ff51c37afa3 (patch) | |
tree | a3fe9caca162847df991c3557ad708254cceff33 /fs/nfs | |
parent | 61540bf6bb40ddfa3e766de91cedca2e1afd24eb (diff) |
NFS: Only look at the change attribute cache state in nfs_weak_revalidate()
Just like in nfs_check_verifier(), we want to use
nfs_mapping_need_revalidate_inode() to check our knowledge of the
change attribute is up to date.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index cb22a9f9ae7e..8f706f3e5c05 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1273,8 +1273,8 @@ out_error: */ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) { - int error; struct inode *inode = d_inode(dentry); + int error = 0; /* * I believe we can only get a negative dentry here in the case of a @@ -1293,7 +1293,8 @@ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) return 0; } - error = nfs_revalidate_inode(NFS_SERVER(inode), inode); + if (nfs_mapping_need_revalidate_inode(inode)) + error = __nfs_revalidate_inode(NFS_SERVER(inode), inode); dfprintk(LOOKUPCACHE, "NFS: %s: inode %lu is %s\n", __func__, inode->i_ino, error ? "invalid" : "valid"); return !error; |