Fix for loop count issue when do_verify=0 (#1093)
authorravisowmya <91231906+ravisowmya@users.noreply.github.com>
Tue, 28 Sep 2021 19:09:38 +0000 (12:09 -0700)
committerSowmya Ravi <sowmyaravi@ad.corp.google.com>
Wed, 29 Sep 2021 17:27:28 +0000 (10:27 -0700)
'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
backend.c

index 86fa6d41f860649e0f83c3aaf740ca9720e6c930..4c2607477c5404fbfc588b0e07d79b367017f997 100644 (file)
--- 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);