summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/io-cache.c
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2009-05-29 13:52:07 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-03 03:37:50 -0700
commit458783bc7a21cd52dd4d3af7fe3059c76b6c0d3d (patch)
tree2d01c99ac66a8b2976353f7d1e72759ac295b266 /xlators/performance/io-cache/src/io-cache.c
parent7c9b551398a660f31358feab366e5ce665a8f372 (diff)
io-cache: prevent frames from getting woken up while page is getting validated
1. A page will be put on the inode waitq if the 'freshness' has to be verified with an fstat() 2. while the fstat is in transit, other calls (like lookup) can update ioc_inode->tv, resetting the freshness (page still on inode waitq) 3. Another read request on the same page, after the updated freshness, will wake up the page frames neglecting the fact that the page is also waiting on the inode (waiting for the fstat completion) 4. once the page's frames are woken, the page becomes elegible for purging and can get destroyed for various reasons, leaving a destroyed page pointer in the inode's waitq 5. fstat returns and hits the destroyed page pointer causing a crash The fix is to all together disable cache hits when any page of the same inode is under validation. The otherwise cache hit will now be subjected to the ongoing validation by getting queued to the inode waitq. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/performance/io-cache/src/io-cache.c')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c
index 8f018fc..fc7ceca 100644
--- a/xlators/performance/io-cache/src/io-cache.c
+++ b/xlators/performance/io-cache/src/io-cache.c
@@ -895,7 +895,7 @@ ioc_dispatch_requests (call_frame_t *frame, ioc_inode_t *ioc_inode, fd_t *fd,
if (trav->ready) {
/* page found in cache */
- if (!might_need_validate) {
+ if (!might_need_validate && !ioc_inode->waitq) {
/* fresh enough */
gf_log (frame->this->name, GF_LOG_TRACE,
"cache hit for trav_offset=%"PRId64""