don't log iopiece when do_verify is off
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 55f3c78c72cbd773cf24a503e30814a9c788e1cf..93c451cb9bd9c69038ae20e45d5fc4f4d30af1fc 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -165,9 +165,8 @@ static int get_next_offset(struct thread_data *td, struct io_u *io_u)
                if (f->last_pos >= f->real_file_size) {
                        if (!td_random(td) || get_next_rand_offset(td, f, ddir, &b))
                                return 1;
                if (f->last_pos >= f->real_file_size) {
                        if (!td_random(td) || get_next_rand_offset(td, f, ddir, &b))
                                return 1;
-               } else {
-                       b = f->last_pos / td->o.min_bs[ddir];
-               }
+               } else
+                       b = (f->last_pos - f->file_offset) / td->o.min_bs[ddir];
        }
 
        io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;
        }
 
        io_u->offset = (b * td->o.min_bs[ddir]) + f->file_offset;
@@ -314,6 +313,9 @@ void requeue_io_u(struct thread_data *td, struct io_u **io_u)
 
 static int fill_io_u(struct thread_data *td, struct io_u *io_u)
 {
 
 static int fill_io_u(struct thread_data *td, struct io_u *io_u)
 {
+       if (td->io_ops->flags & FIO_NOIO)
+               goto out;
+
        /*
         * see if it's time to sync
         */
        /*
         * see if it's time to sync
         */
@@ -761,6 +763,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                io_u_mark_latency(td, usec);
 
                if (td_write(td) && idx == DDIR_WRITE &&
                io_u_mark_latency(td, usec);
 
                if (td_write(td) && idx == DDIR_WRITE &&
+                   td->o.do_verify &&
                    td->o.verify != VERIFY_NONE)
                        log_io_piece(td, io_u);
 
                    td->o.verify != VERIFY_NONE)
                        log_io_piece(td, io_u);