summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2019-09-19 20:22:56 +0530
committerRaghavendra G <rgowdapp@redhat.com>2019-10-11 06:03:44 +0000
commit134fcea8e245fd5033151392b6265d0dcc87a900 (patch)
tree9928632aeaae28040b26660ea66ae72da18193e1
parent3016bfa40ce33f89fbfffb564184576f08caf3d7 (diff)
performance/read-ahead: update expected offset before unwinding read response
With the current code there is a window of time between unwinding response to a read request and internal offset is updated to account the read just done. If new sequential read request comes in this time window, it is incorrectly identified as non-sequential read. Fix is to update the file offset to account for a read request before sending back the response to it. Change-Id: Iff0c59c769e1eb15f262257763026657e2d4785d Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Fixes: bz#1753843
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index e6bfd25..5246e13 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -513,10 +513,10 @@ ra_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
read_ahead(frame, file);
- ra_frame_return(frame);
-
file->offset = offset + size;
+ ra_frame_return(frame);
+
return 0;
unwind: