From 80f021501fda6a6244672bb89dd8221a61cee54b Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 31 May 2018 09:05:59 -0600 Subject: [PATCH 1/1] io_u: ensure to invalidate cache on time_based random reads We need to do this with the file reset and retrieval of a new offset, not of it fails. Fixes: 0bcf41cdc22df ("io_u: re-invalidate cache when looping around without file open/close") Signed-off-by: Jens Axboe --- io_u.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_u.c b/io_u.c index 5b4c0df0..945aa192 100644 --- a/io_u.c +++ b/io_u.c @@ -325,9 +325,9 @@ static int get_next_rand_block(struct thread_data *td, struct fio_file *f, if (td->o.time_based || (td->o.file_service_type & __FIO_FSERVICE_NONUNIFORM)) { fio_file_reset(td, f); + loop_cache_invalidate(td, f); if (!get_next_rand_offset(td, f, ddir, b)) return 0; - loop_cache_invalidate(td, f); } dprint(FD_IO, "%s: rand offset failed, last=%llu, size=%llu\n", -- 2.25.1