aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/inode.c8
-rw-r--r--include/linux/nfs_fs.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 65d5ab45ddc5..449df8c8aa31 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1135,7 +1135,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
1135 * We may need to keep the attributes marked as invalid if 1135 * We may need to keep the attributes marked as invalid if
1136 * we raced with nfs_end_attr_update(). 1136 * we raced with nfs_end_attr_update().
1137 */ 1137 */
1138 if (verifier == nfsi->cache_change_attribute) 1138 if (time_after_eq(verifier, nfsi->cache_change_attribute))
1139 nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME); 1139 nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME);
1140 spin_unlock(&inode->i_lock); 1140 spin_unlock(&inode->i_lock);
1141 1141
@@ -1202,7 +1202,7 @@ void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
1202 if (S_ISDIR(inode->i_mode)) { 1202 if (S_ISDIR(inode->i_mode)) {
1203 memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf)); 1203 memset(nfsi->cookieverf, 0, sizeof(nfsi->cookieverf));
1204 /* This ensures we revalidate child dentries */ 1204 /* This ensures we revalidate child dentries */
1205 nfsi->cache_change_attribute++; 1205 nfsi->cache_change_attribute = jiffies;
1206 } 1206 }
1207 spin_unlock(&inode->i_lock); 1207 spin_unlock(&inode->i_lock);
1208 1208
@@ -1242,7 +1242,7 @@ void nfs_end_data_update(struct inode *inode)
1242 nfsi->cache_validity |= NFS_INO_INVALID_DATA; 1242 nfsi->cache_validity |= NFS_INO_INVALID_DATA;
1243 spin_unlock(&inode->i_lock); 1243 spin_unlock(&inode->i_lock);
1244 } 1244 }
1245 nfsi->cache_change_attribute ++; 1245 nfsi->cache_change_attribute = jiffies;
1246 atomic_dec(&nfsi->data_updates); 1246 atomic_dec(&nfsi->data_updates);
1247} 1247}
1248 1248
@@ -1391,7 +1391,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr, unsign
1391 /* Do we perhaps have any outstanding writes? */ 1391 /* Do we perhaps have any outstanding writes? */
1392 if (nfsi->npages == 0) { 1392 if (nfsi->npages == 0) {
1393 /* No, but did we race with nfs_end_data_update()? */ 1393 /* No, but did we race with nfs_end_data_update()? */
1394 if (verifier == nfsi->cache_change_attribute) { 1394 if (time_after_eq(verifier, nfsi->cache_change_attribute)) {
1395 inode->i_size = new_isize; 1395 inode->i_size = new_isize;
1396 invalid |= NFS_INO_INVALID_DATA; 1396 invalid |= NFS_INO_INVALID_DATA;
1397 } 1397 }
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8120fd68dee5..abf890f5fbfb 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -280,7 +280,7 @@ static inline long nfs_save_change_attribute(struct inode *inode)
280static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr) 280static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long chattr)
281{ 281{
282 return !nfs_caches_unstable(inode) 282 return !nfs_caches_unstable(inode)
283 && chattr == NFS_I(inode)->cache_change_attribute; 283 && time_after_eq(chattr, NFS_I(inode)->cache_change_attribute);
284} 284}
285 285
286/* 286/*