aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-07-05 11:02:53 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-07-22 17:15:53 -0400
commit85a23cee3f2c928475f31777ead5a71340a12fc3 (patch)
treead9490a8caf900365ee4e78cb5936e2dd6c3cb8b /fs
parent2b83d3de4c18af49800e0b26ae013db4fcf43a4a (diff)
NFS: Don't revalidate the mapping if both size and change attr are up to date
If we've ensured that the size and the change attribute are both correct, then there is no point in marking those attributes as needing revalidation again. Only do so if we know the size is incorrect and was not updated. Fixes: f2467b6f64da ("NFS: Clear NFS_INO_REVAL_PAGECACHE when...") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index b77b328a06d7..d654661defb3 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1244,9 +1244,11 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat
1244 if (fattr->valid & NFS_ATTR_FATTR_SIZE) { 1244 if (fattr->valid & NFS_ATTR_FATTR_SIZE) {
1245 cur_size = i_size_read(inode); 1245 cur_size = i_size_read(inode);
1246 new_isize = nfs_size_to_loff_t(fattr->size); 1246 new_isize = nfs_size_to_loff_t(fattr->size);
1247 if (cur_size != new_isize && nfsi->nrequests == 0) 1247 if (cur_size != new_isize)
1248 invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE; 1248 invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
1249 } 1249 }
1250 if (nfsi->nrequests != 0)
1251 invalid &= ~NFS_INO_REVAL_PAGECACHE;
1250 1252
1251 /* Have any file permissions changed? */ 1253 /* Have any file permissions changed? */
1252 if ((fattr->valid & NFS_ATTR_FATTR_MODE) && (inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO)) 1254 if ((fattr->valid & NFS_ATTR_FATTR_MODE) && (inode->i_mode & S_IALLUGO) != (fattr->mode & S_IALLUGO))
@@ -1684,8 +1686,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
1684 invalid |= NFS_INO_INVALID_ATTR 1686 invalid |= NFS_INO_INVALID_ATTR
1685 | NFS_INO_INVALID_DATA 1687 | NFS_INO_INVALID_DATA
1686 | NFS_INO_INVALID_ACCESS 1688 | NFS_INO_INVALID_ACCESS
1687 | NFS_INO_INVALID_ACL 1689 | NFS_INO_INVALID_ACL;
1688 | NFS_INO_REVAL_PAGECACHE;
1689 if (S_ISDIR(inode->i_mode)) 1690 if (S_ISDIR(inode->i_mode))
1690 nfs_force_lookup_revalidate(inode); 1691 nfs_force_lookup_revalidate(inode);
1691 inode->i_version = fattr->change_attr; 1692 inode->i_version = fattr->change_attr;
@@ -1717,7 +1718,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
1717 if ((nfsi->nrequests == 0) || new_isize > cur_isize) { 1718 if ((nfsi->nrequests == 0) || new_isize > cur_isize) {
1718 i_size_write(inode, new_isize); 1719 i_size_write(inode, new_isize);
1719 invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA; 1720 invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
1720 invalid &= ~NFS_INO_REVAL_PAGECACHE;
1721 } 1721 }
1722 dprintk("NFS: isize change on server for file %s/%ld " 1722 dprintk("NFS: isize change on server for file %s/%ld "
1723 "(%Ld to %Ld)\n", 1723 "(%Ld to %Ld)\n",