diff options
author | Brian Foster <bfoster@redhat.com> | 2012-04-02 09:56:42 -0400 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-04-02 11:25:12 -0700 |
commit | dcfd0f4ee8c3c405f768cbb79219c0c5fa071a56 (patch) | |
tree | d8a0ae7ceef99d042008a9d30e990c973f616d30 /xlators/performance/md-cache/src | |
parent | b0bb1a2c979078efa3ab024e14119df6087c4320 (diff) |
md-cache: fix time comparison to support 0 timeout
The time comparison currently causes caching when the current
time matches the timeout. This causes caching to occur even
when the timeout parameter is set to 0. Fix the condition to
support the no caching scenario. A longer term approach is to
use gettimeofday() for more accurate granularity, but this
apparently fixes a known bug.
Change-Id: I6552c5961743edb22a1aec2e6a3a6e041d0647b2
BUG: 809193
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.com/3066
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/performance/md-cache/src')
-rw-r--r-- | xlators/performance/md-cache/src/md-cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 13396a44e8a..dd161ce84bb 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -315,7 +315,7 @@ is_md_cache_iatt_valid (xlator_t *this, struct md_cache *mdc) LOCK (&mdc->lock); { - if (now > (mdc->ia_time + conf->timeout)) + if (now >= (mdc->ia_time + conf->timeout)) ret = _gf_false; } UNLOCK (&mdc->lock); @@ -337,7 +337,7 @@ is_md_cache_xatt_valid (xlator_t *this, struct md_cache *mdc) LOCK (&mdc->lock); { - if (now > (mdc->xa_time + conf->timeout)) + if (now >= (mdc->xa_time + conf->timeout)) ret = _gf_false; } UNLOCK (&mdc->lock); |