From bba6b14f3588fd21e6181c0c9194d8f95533aff6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 10 Aug 2020 20:53:55 -0600 Subject: [PATCH] io_u: reset ->resid on starting a requeue IO We only clear this state for a new IO, we should also do it for starting a requeued IO. Signed-off-by: Jens Axboe --- io_u.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/io_u.c b/io_u.c index 6a729e51..667530c0 100644 --- 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; -- 2.25.1