From: ravisowmya <91231906+ravisowmya@users.noreply.github.com> Date: Tue, 28 Sep 2021 19:09:38 +0000 (-0700) Subject: Fix for loop count issue when do_verify=0 (#1093) X-Git-Tag: fio-3.29~87^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=499cded5f435a0a7c379b606eb3e903d7f43c360;p=fio.git Fix for loop count issue when do_verify=0 (#1093) 'clear_io_state' is called twice and resets the nr_done_files. 'clear_io_state' resets the nr_done_files if loop>=1. This API is called twice with in thread_main and the second call is skipped if do_verify=0. We rely on the first call for setup management. So, for the very last loop, we would have skipped reseting 'nr_done_files' because loops=0 resulting in an IO error in do_io and we exit without performing any IOs. Fix will invoke the second call to clear_io_state Signed-off-by: Sowmya Ravi sowmyaravi.92@gmail.com --- diff --git a/backend.c b/backend.c index 86fa6d41..4c260747 100644 --- a/backend.c +++ b/backend.c @@ -1920,13 +1920,13 @@ static void *thread_main(void *data) if (td->error || td->terminate) break; + clear_io_state(td, 0); + if (!o->do_verify || o->verify == VERIFY_NONE || td_ioengine_flagged(td, FIO_UNIDIR)) continue; - clear_io_state(td, 0); - fio_gettime(&td->start, NULL); do_verify(td, verify_bytes);