diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2019-09-19 20:22:56 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2019-10-11 06:03:44 +0000 |
commit | 134fcea8e245fd5033151392b6265d0dcc87a900 (patch) | |
tree | 9928632aeaae28040b26660ea66ae72da18193e1 /xlators/performance | |
parent | 3016bfa40ce33f89fbfffb564184576f08caf3d7 (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
Diffstat (limited to 'xlators/performance')
-rw-r--r-- | xlators/performance/read-ahead/src/read-ahead.c | 4 |
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 e6bfd25641e..5246e1317d2 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: |