From 615c794cbf851c994e94fffe8b8f565e64f137a5 Mon Sep 17 00:00:00 2001 From: Horshack Date: Thu, 9 Feb 2023 21:47:38 -0500 Subject: [PATCH] Read stats for backlog verifies not reported for time-expired workloads When verify_backlog is used on a write-only workload with a runtime= value and the runtime expires before the workload has written its full dataset, the read stats for the backlog verifies are not reported, resulting in a stat result showing only the workload writes (ie, the "read:" results section is completely missing from fio's stats output) The logic in thread_main() fails to call update_runtime() for DDIR_READ because the existing call to update_runtime() for DDIR_READ on write-only workloads is currently only done after do_verify() is complete, which wont be called in this scenario because td->terminate is true due to the expiration of the runtime. Link: https://github.com/axboe/fio/issues/1515 Signed-off-by: Adam Horshack (horshack@live.com) --- backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend.c b/backend.c index 928e524a..c6b97dd9 100644 --- a/backend.c +++ b/backend.c @@ -1919,7 +1919,8 @@ static void *thread_main(void *data) } } while (1); - if (td_read(td) && td->io_bytes[DDIR_READ]) + if (td->io_bytes[DDIR_READ] && (td_read(td) || + ((td->flags & TD_F_VER_BACKLOG) && td_write(td)))) update_runtime(td, elapsed_us, DDIR_READ); if (td_write(td) && td->io_bytes[DDIR_WRITE]) update_runtime(td, elapsed_us, DDIR_WRITE); -- 2.25.1