Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d2b2966869142660f46d1e06cf9d15c3debcf77
Commit:     6d2b2966869142660f46d1e06cf9d15c3debcf77
Parent:     60ccd4ec4170c9487e3792322626acd160197bce
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 1 18:57:50 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:19:55 2007 -0400

    NFS: Reset nfsi->last_updated only if the attribute changed
    
    Otherwise set it to nfsi->read_cache_jiffies in order to prevent jiffy
    wraparound issues.
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/inode.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index 1c23d3a..9d012a6 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -956,7 +956,6 @@ static int nfs_update_inode(struct inode *inode, struct 
nfs_fattr *fattr)
         * Update the read time so we don't revalidate too often.
         */
        nfsi->read_cache_jiffies = fattr->time_start;
-       nfsi->last_updated = now;
 
        nfsi->cache_validity &= ~(NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ATIME
                        | NFS_INO_REVAL_PAGECACHE);
@@ -1027,10 +1026,18 @@ static int nfs_update_inode(struct inode *inode, struct 
nfs_fattr *fattr)
                nfs_inc_stats(inode, NFSIOS_ATTRINVALIDATE);
                nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
                nfsi->attrtimeo_timestamp = now;
-       } else if (!time_in_range(now, nfsi->attrtimeo_timestamp, 
nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
-               if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
-                       nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
-               nfsi->attrtimeo_timestamp = now;
+               nfsi->last_updated = now;
+       } else {
+               if (!time_in_range(now, nfsi->attrtimeo_timestamp, 
nfsi->attrtimeo_timestamp + nfsi->attrtimeo)) {
+                       if ((nfsi->attrtimeo <<= 1) > NFS_MAXATTRTIMEO(inode))
+                               nfsi->attrtimeo = NFS_MAXATTRTIMEO(inode);
+                       nfsi->attrtimeo_timestamp = now;
+               }
+               /*
+                * Avoid jiffy wraparound issues with nfsi->last_updated
+                */
+               if (!time_in_range(nfsi->last_updated, 
nfsi->read_cache_jiffies, now))
+                       nfsi->last_updated = nfsi->read_cache_jiffies;
        }
        invalid &= ~NFS_INO_INVALID_ATTR;
        /* Don't invalidate the data if we were to blame */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to