summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/read-ahead/src/page.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c
index 216e327af74..17e346ec947 100644
--- a/xlators/performance/read-ahead/src/page.c
+++ b/xlators/performance/read-ahead/src/page.c
@@ -139,6 +139,7 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
ra_waitq_t *waitq = NULL;
fd_t *fd = NULL;
uint64_t tmp_file = 0;
+ gf_boolean_t stale = _gf_false;
GF_ASSERT (frame);
@@ -174,6 +175,13 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto unlock;
}
+ if (page->stale) {
+ page->stale = 0;
+ page->ready = 0;
+ stale = 1;
+ goto unlock;
+ }
+
/*
* "Dirty" means that the request was a pure read-ahead; it's
* set for requests we issue ourselves, and cleared when user
@@ -219,6 +227,16 @@ ra_fault_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
unlock:
ra_file_unlock (file);
+ if (stale) {
+ STACK_WIND (frame, ra_fault_cbk,
+ FIRST_CHILD (frame->this),
+ FIRST_CHILD (frame->this)->fops->readv,
+ local->fd, local->pending_size,
+ local->pending_offset, 0, NULL);
+
+ return 0;
+ }
+
ra_waitq_return (waitq);
fd_unref (local->fd);