From 095196b1e76b1722c37beeeba7df7b2a615688a0 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 9 Dec 2015 08:28:00 -0700 Subject: [PATCH] backend: terminate loop if we didn't do IO The below commit modified how we clear stats, and that can sometimes cause fio to hang around when ramp + runtime has been exceeded. The below job file showed the issue: [test-job] bs=4k rw=read direct=1 runtime=6s ramp_time=5s ioengine=null iodepth=32 size=100g Where it would do the ramp time, then count down the 6s of runtime, then fio would just sit there busy looping. Fixes: ac28d9053679 ("Fixup bw/iops logging for short runs") Signed-off-by: Jens Axboe --- backend.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend.c b/backend.c index ae261203..425b0ee9 100644 --- a/backend.c +++ b/backend.c @@ -1587,8 +1587,11 @@ static void *thread_main(void *data) if (td->o.verify_only && (td_write(td) || td_rw(td))) verify_bytes = do_dry_run(td); - else + else { verify_bytes = do_io(td); + if (!verify_bytes) + fio_mark_td_terminate(td); + } clear_state = 1; -- 2.25.1