summaryrefslogtreecommitdiffstats
path: root/xlators/performance
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:22:51 -0700
commit2dc70c22bdd25362a95f19ab551d39e99f76ebfb (patch)
tree0c2679fdcc7216baa3c1b1cdfeafeb6f9877ed41 /xlators/performance
parent834efc91985b7a572e5acd9be463eb8ffdf3ba11 (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')
-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 8f018fc75bf..fc7ceca57af 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""