From c16035aadd600a3a4c4b241339e3d3099f56c4b2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 28 Sep 2017 06:58:23 -0600 Subject: [PATCH] backend: fix a case where we complain about no IO being done If we're just doing a read phase verify, then we clear bytes_done before we can check it at the end. Ensure that we always notice if we did IO, so we don't spew this warning: job_0: No I/O performed by libaio, perhaps try --debug=io option for details? when we actually did do exactly what we had to. Signed-off-by: Jens Axboe --- backend.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 6198c3d9..e4eff378 100644 --- a/backend.c +++ b/backend.c @@ -1505,7 +1505,7 @@ static void *thread_main(void *data) struct sk_out *sk_out = fd->sk_out; uint64_t bytes_done[DDIR_RWDIR_CNT]; int deadlock_loop_cnt; - int clear_state; + bool clear_state, did_some_io; int ret; sk_out_assign(sk_out); @@ -1726,7 +1726,8 @@ static void *thread_main(void *data) } memset(bytes_done, 0, sizeof(bytes_done)); - clear_state = 0; + clear_state = false; + did_some_io = false; while (keep_running(td)) { uint64_t verify_bytes; @@ -1765,7 +1766,7 @@ static void *thread_main(void *data) if (td->runstate >= TD_EXITED) break; - clear_state = 1; + clear_state = true; /* * Make sure we've successfully updated the rusage stats @@ -1804,6 +1805,9 @@ static void *thread_main(void *data) td_ioengine_flagged(td, FIO_UNIDIR)) continue; + if (ddir_rw_sum(bytes_done)) + did_some_io = true; + clear_io_state(td, 0); fio_gettime(&td->start, NULL); @@ -1830,6 +1834,7 @@ static void *thread_main(void *data) * (Are we not missing other flags that can be ignored ?) */ if ((td->o.size || td->o.io_size) && !ddir_rw_sum(bytes_done) && + !did_some_io && !(td_ioengine_flagged(td, FIO_NOIO) || td_ioengine_flagged(td, FIO_DISKLESSIO))) log_err("%s: No I/O performed by %s, " -- 2.25.1