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>
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);
}