Fix ETA calculations
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 9f10206b95e8b1e80d14504c35159284cf238802..6b6b47d0a1e1284c24bc25fd74aa6d87ff7b97d6 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -488,7 +488,7 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u,
                        }
                }
 
-               if (td->o.do_verify && td->o.verify != VERIFY_NONE)
+               if (td->o.verify != VERIFY_NONE)
                        buflen = (buflen + td->o.verify_interval - 1) &
                                ~(td->o.verify_interval - 1);
 
@@ -1578,6 +1578,13 @@ static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
                io_ddir_name(io_u->ddir),
                io_u->offset, io_u->xfer_buflen);
 
+       if (td->io_ops->errdetails) {
+               char *err = td->io_ops->errdetails(io_u);
+
+               log_err("fio: %s\n", err);
+               free(err);
+       }
+
        if (!td->error)
                td_verror(td, io_u->error, "io_u error");
 }
@@ -1829,7 +1836,9 @@ int io_u_queued_complete(struct thread_data *td, int min_evts)
        else if (min_evts > td->cur_depth)
                min_evts = td->cur_depth;
 
-       ret = td_io_getevents(td, min_evts, td->o.iodepth_batch_complete, tvp);
+       /* No worries, td_io_getevents fixes min and max if they are
+        * set incorrectly */
+       ret = td_io_getevents(td, min_evts, td->o.iodepth_batch_complete_max, tvp);
        if (ret < 0) {
                td_verror(td, -ret, "td_io_getevents");
                return ret;