From: Jens Axboe Date: Wed, 5 Feb 2014 19:36:02 +0000 (-0700) Subject: Fix for prematurely stopping on verify X-Git-Tag: fio-2.1.5~15 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=c2703bf35e146872d12f85c9e6490008b5fabb34 Fix for prematurely stopping on verify Commit 20876c53 added a total byte check, but forgot to account for potential verification bytes. Fix that. Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index bf9d066e..3ac72e77 100644 --- a/backend.c +++ b/backend.c @@ -642,7 +642,7 @@ static uint64_t do_io(struct thread_data *td) uint64_t bytes_done[DDIR_RWDIR_CNT] = { 0, 0, 0 }; unsigned int i; int ret = 0; - uint64_t bytes_issued = 0; + uint64_t total_bytes, bytes_issued = 0; if (in_ramp_time(td)) td_set_runstate(td, TD_RAMP); @@ -651,6 +651,10 @@ static uint64_t do_io(struct thread_data *td) lat_target_init(td); + total_bytes = td->o.size; + if (td->o.verify != VERIFY_NONE && td_write(td)) + total_bytes += td->o.size; + while ((td->o.read_iolog_file && !flist_empty(&td->io_log_list)) || (!flist_empty(&td->trim_list)) || !io_bytes_exceeded(td) || td->o.time_based) { @@ -678,7 +682,7 @@ static uint64_t do_io(struct thread_data *td) if (flow_threshold_exceeded(td)) continue; - if (bytes_issued >= (uint64_t) td->o.size) + if (bytes_issued >= total_bytes) break; io_u = get_io_u(td);