ioengines: clear in-flight bit for FIO_Q_BUSY syncs
authorVincent Fu <vincent.fu@samsung.com>
Wed, 28 May 2025 19:13:03 +0000 (19:13 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Mon, 2 Jun 2025 16:35:42 +0000 (12:35 -0400)
If a sync operation is ever requeued after a previous queue attempt
returns FIO_Q_BUSY the assertion checking that the IO_U_F_FLIGHT bit is
not set will fail because this bit is not cleared when the FIO_Q_BUSY
return value is processed.

This patch makes sure that we clear IO_U_F_FLIGHT when the queue attempt
returns FIO_Q_BUSY for sync operations. The counters that are restored
are not defined for sync operations, so we cannot modify them.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
ioengines.c

index 05d01a0f0782daa9a72a5326488d2c84ada64cfc..9f75e66c6ddf1eee9528186ffe9f723d670b108c 100644 (file)
@@ -390,10 +390,12 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
 
        unlock_file(td, io_u->file);
 
-       if (ret == FIO_Q_BUSY && ddir_rw(ddir)) {
-               td->io_issues[ddir]--;
-               td->io_issue_bytes[ddir] -= buflen;
-               td->rate_io_issue_bytes[ddir] -= buflen;
+       if (ret == FIO_Q_BUSY) {
+              if (ddir_rw(ddir)) {
+                       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);
        }