Merge branch 'patch-1' of https://github.com/Nikratio/fio
[fio.git] / backend.c
index 4c2607477c5404fbfc588b0e07d79b367017f997..c167f908625f39fd8e344c9f75c705f7fd71adf4 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -837,7 +837,7 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir)
        if (td->o.rate_process == RATE_PROCESS_POISSON) {
                uint64_t val, iops;
 
-               iops = bps / td->o.bs[ddir];
+               iops = bps / td->o.min_bs[ddir];
                val = (int64_t) (1000000 / iops) *
                                -logf(__rand_0_1(&td->poisson_state[ddir]));
                if (val) {
@@ -1920,13 +1920,13 @@ static void *thread_main(void *data)
                if (td->error || td->terminate)
                        break;
 
-               clear_io_state(td, 0);
-               
                if (!o->do_verify ||
                    o->verify == VERIFY_NONE ||
                    td_ioengine_flagged(td, FIO_UNIDIR))
                        continue;
 
+               clear_io_state(td, 0);
+
                fio_gettime(&td->start, NULL);
 
                do_verify(td, verify_bytes);