Fix for prematurely stopping on verify
authorJens Axboe <axboe@fb.com>
Wed, 5 Feb 2014 19:36:02 +0000 (12:36 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 5 Feb 2014 19:36:02 +0000 (12:36 -0700)
Commit 20876c53 added a total byte check, but forgot to
account for potential verification bytes. Fix that.

Signed-off-by: Jens Axboe <axboe@fb.com>
backend.c

index bf9d066e012abc8a44a938fcbf319a68a81d6d64..3ac72e771cb9eaa44a17fabe70d9aee718ccd6a5 100644 (file)
--- 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);