aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c2
-rw-r--r--fs/nfs/inode.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index dd02db43cbe6..6e0aa04451dd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1855,7 +1855,7 @@ int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, struct nfs
1855 cache = nfs_access_search_rbtree(inode, cred); 1855 cache = nfs_access_search_rbtree(inode, cred);
1856 if (cache == NULL) 1856 if (cache == NULL)
1857 goto out; 1857 goto out;
1858 if (time_after(jiffies, cache->jiffies + NFS_ATTRTIMEO(inode))) 1858 if (!time_in_range(jiffies, cache->jiffies, cache->jiffies + NFS_ATTRTIMEO(inode)))
1859 goto out_stale; 1859 goto out_stale;
1860 res->jiffies = cache->jiffies; 1860 res->jiffies = cache->jiffies;
1861 res->cred = cache->cred; 1861 res->cred = cache->cred;
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 3ad938cecd73..7c8ca175d87b 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -656,7 +656,7 @@ int nfs_attribute_timeout(struct inode *inode)
656 656
657 if (nfs_have_delegation(inode, FMODE_READ)) 657 if (nfs_have_delegation(inode, FMODE_READ))
658 return 0; 658 return 0;
659 return time_after(jiffies, nfsi->read_cache_jiffies+nfsi->attrtimeo); 659 return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo);
660} 660}
661 661
662/** 662/**
@@ -1055,7 +1055,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
1055 nfs_inc_stats(inode, NFSIOS_ATTRINVALIDATE); 1055 nfs_inc_stats(inode, NFSIOS_ATTRINVALIDATE);
1056 nfsi->attrtimeo = NFS_MINATTRTIMEO(inode); 1056 nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
1057 nfsi->attrtimeo_timestamp = now; 1057 nfsi->attrtimeo_timestamp = now;
1058 } else if (time_after(now, nfsi->attrtimeo_timestamp+nfsi->attrtimeo)) { 1058 } else if (!time_in_range(now, nfsi->attrtimeo_timestamp, nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
1059 if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode)) 1059 if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
1060 nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode); 1060 nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
1061 nfsi->attrtimeo_timestamp = now; 1061 nfsi->attrtimeo_timestamp = now;