io_u: reset ->resid on starting a requeue IO
authorJens Axboe <axboe@kernel.dk>
Tue, 11 Aug 2020 02:53:55 +0000 (20:53 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Aug 2020 02:53:55 +0000 (20:53 -0600)
We only clear this state for a new IO, we should also do it for starting
a requeued IO.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
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;