The following changes since commit 905c78b90f92bab91555313f7b4bd83d18246139: server: fix bad win32 indentation (2012-03-06 19:34:22 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (3): Fix bug that causes early termination of fio with verify_backlog Add regression test for f7078f7b Fix batch mismatch for verifies backend.c | 19 ++++++++++++++++--- io_u.c | 9 +++++---- t/jobs/t0005-f7078f7b.fio | 13 +++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 t/jobs/t0005-f7078f7b.fio --- Diff of recent changes: diff --git a/backend.c b/backend.c index f3f1030..814d244 100644 --- a/backend.c +++ b/backend.c @@ -526,6 +526,20 @@ sync_done: dprint(FD_VERIFY, "exiting loop\n"); } +static int io_bytes_exceeded(struct thread_data *td) +{ + unsigned long long bytes; + + if (td_rw(td)) + bytes = td->this_io_bytes[0] + td->this_io_bytes[1]; + else if (td_write(td)) + bytes = td->this_io_bytes[1]; + else + bytes = td->this_io_bytes[0]; + + return bytes >= td->o.size; +} + /* * Main IO worker function. It retrieves io_u's to process and queues * and reaps them, checking for rate and errors along the way. @@ -540,9 +554,8 @@ static void do_io(struct thread_data *td) else td_set_runstate(td, TD_RUNNING); - while ( (td->o.read_iolog_file && !flist_empty(&td->io_log_list)) || - (!flist_empty(&td->trim_list)) || - ((td->this_io_bytes[0] + td->this_io_bytes[1]) < td->o.size) ) { + while ((td->o.read_iolog_file && !flist_empty(&td->io_log_list)) || + (!flist_empty(&td->trim_list)) || !io_bytes_exceeded(td)) { struct timeval comp_time; unsigned long bytes_done[2] = { 0, 0 }; int min_evts = 0; diff --git a/io_u.c b/io_u.c index 2deb5c7..06ca711 100644 --- a/io_u.c +++ b/io_u.c @@ -1117,10 +1117,9 @@ static int check_get_verify(struct thread_data *td, struct io_u *io_u) if (td->o.verify_backlog && td->io_hist_len) { int get_verify = 0; - if (td->verify_batch) { - td->verify_batch--; + if (td->verify_batch) get_verify = 1; - } else if (!(td->io_hist_len % td->o.verify_backlog) && + else if (!(td->io_hist_len % td->o.verify_backlog) && td->last_ddir != DDIR_READ) { td->verify_batch = td->o.verify_batch; if (!td->verify_batch) @@ -1128,8 +1127,10 @@ static int check_get_verify(struct thread_data *td, struct io_u *io_u) get_verify = 1; } - if (get_verify && !get_next_verify(td, io_u)) + if (get_verify && !get_next_verify(td, io_u)) { + td->verify_batch--; return 1; + } } return 0; diff --git a/t/jobs/t0005-f7078f7b.fio b/t/jobs/t0005-f7078f7b.fio new file mode 100644 index 0000000..3481d63 --- /dev/null +++ b/t/jobs/t0005-f7078f7b.fio @@ -0,0 +1,13 @@ +# Expected result: fio reads and writes 100m +# Buggy result: fio reads and writes ~100m/2 +[global] +bs=4k +ioengine=sync +size=100m +direct=1 +filename=xxx + +[write] +verify=md5 +verify_backlog=32 +rw=write -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html