--- linux-2.6.25.i686/fs/nfs/inode.c.org +++ linux-2.6.25.i686/fs/nfs/inode.c @@ -706,13 +706,6 @@ int nfs_attribute_timeout(struct inode * if (nfs_have_delegation(inode, FMODE_READ)) return 0; - /* - * Special case: if the attribute timeout is set to 0, then always - * treat the cache as having expired (unless holding - * a delegation). - */ - if (nfsi->attrtimeo == 0) - return 1; return !time_in_range(jiffies, nfsi->read_cache_jiffies, nfsi->read_cache_jiffies + nfsi->attrtimeo); } --- linux-2.6.25.i686/include/linux/nfs_fs.h.org +++ linux-2.6.25.i686/include/linux/nfs_fs.h @@ -121,7 +121,10 @@ struct nfs_inode { * * We need to revalidate the cached attrs for this inode if * - * jiffies - read_cache_jiffies > attrtimeo + * jiffies - read_cache_jiffies >= attrtimeo + * + * Please note the comparison is greater than or equal + * so that zero timeout values can be specified. */ unsigned long read_cache_jiffies; unsigned long attrtimeo; --- linux-2.6.25.i686/include/linux/jiffies.h.org +++ linux-2.6.25.i686/include/linux/jiffies.h @@ -115,9 +115,12 @@ static inline u64 get_jiffies_64(void) ((long)(a) - (long)(b) >= 0)) #define time_before_eq(a,b) time_after_eq(b,a) +/* + * Calculate whether a in the range of [b, c). + */ #define time_in_range(a,b,c) \ (time_after_eq(a,b) && \ - time_before_eq(a,c)) + time_before(a,c)) /* Same as above, but does so with platform independent 64bit types. * These must be used when utilizing jiffies_64 (i.e. return value of