From 871467d9b6a804632c8c952a61fc3065b3e1e93f Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeer Date: Sun, 27 Nov 2016 10:34:53 +0000 Subject: [PATCH] ioengines: Fix td->io_issues[ddir] over decrement If an ioengine returned FIO_Q_BUSY, td->io_issues[ddir] would be over decremented: once in td_io_queue() and then again in requeue_io_u(). This was because td_io_queue() reverted various values upon finding the queue busy but requeue_io_u() found the I/O was still in flight so decremented again. This then showed up as unsigned underflow on td->io_issues[ddir]. Fix this by clearing IO_U_F_FLIGHT on the I/O when we find the queue was busy in td_io_queue(). Signed-off-by: Sitsofe Wheeer --- ioengines.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ioengines.c b/ioengines.c index 4c53fe55..1b581686 100644 --- a/ioengines.c +++ b/ioengines.c @@ -298,6 +298,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) td->io_issues[ddir]--; td->io_issue_bytes[ddir] -= buflen; td->rate_io_issue_bytes[ddir] -= buflen; + io_u_clear(td, io_u, IO_U_F_FLIGHT); } /* -- 2.25.1