Commit e323ea46 authored by Trond Myklebust's avatar Trond Myklebust

NFS: nfs_wcc_update_inode: directory caches are always invalidated

We must ensure that the readdir data is always invalidated whether or not
the weak cache consistency data update succeeds.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6ecc5e8f
...@@ -801,6 +801,8 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) ...@@ -801,6 +801,8 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
} }
if (timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) { if (timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) {
memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
if (S_ISDIR(inode->i_mode))
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
nfsi->cache_change_attribute = now; nfsi->cache_change_attribute = now;
} }
if (inode->i_size == fattr->pre_size && nfsi->npages == 0) { if (inode->i_size == fattr->pre_size && nfsi->npages == 0) {
......
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