Commit 9cdd1d3f authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 61540bf6
...@@ -1273,8 +1273,8 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -1273,8 +1273,8 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
*/ */
static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags)
{ {
int error;
struct inode *inode = d_inode(dentry); struct inode *inode = d_inode(dentry);
int error = 0;
/* /*
* I believe we can only get a negative dentry here in the case of a * 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) ...@@ -1293,7 +1293,8 @@ static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags)
return 0; 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", dfprintk(LOOKUPCACHE, "NFS: %s: inode %lu is %s\n",
__func__, inode->i_ino, error ? "invalid" : "valid"); __func__, inode->i_ino, error ? "invalid" : "valid");
return !error; return !error;
......
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