io_u: reset ->resid on starting a requeue IO
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 6a729e513c60a8e6fcfa87fb7958c0b6af84efbf..667530c0f651a90888a826bf98d34ebb3abb89aa 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1564,9 +1564,10 @@ struct io_u *__get_io_u(struct thread_data *td)
                __td_io_u_lock(td);
 
 again:
-       if (!io_u_rempty(&td->io_u_requeues))
+       if (!io_u_rempty(&td->io_u_requeues)) {
                io_u = io_u_rpop(&td->io_u_requeues);
-       else if (!queue_full(td)) {
+               io_u->resid = 0;
+       } else if (!queue_full(td)) {
                io_u = io_u_qpop(&td->io_u_freelist);
 
                io_u->file = NULL;