From 134fcea8e245fd5033151392b6265d0dcc87a900 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 19 Sep 2019 20:22:56 +0530 Subject: 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 Fixes: bz#1753843 --- xlators/performance/read-ahead/src/read-ahead.c | 4 ++-- 1 file 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: -- cgit