backend: ensure that fio_io_sync() commits IN on queued status
[fio.git] / backend.c
index edc0644a113b259cf2d65cf91f96175a5f50201b..6083a51e7e5478557b1f7c4f79fb84363cde1bbc 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -309,6 +309,8 @@ requeue:
                put_io_u(td, io_u);
                return true;
        } else if (ret == FIO_Q_QUEUED) {
+               if (td_io_commit(td))
+                       return true;
                if (io_u_queued_complete(td, 1) < 0)
                        return true;
        } else if (ret == FIO_Q_COMPLETED) {
@@ -520,6 +522,14 @@ sync_done:
                        if (*ret < 0)
                                break;
                }
+
+               /*
+                * when doing I/O (not when verifying),
+                * check for any errors that are to be ignored
+                */
+               if (!from_verify)
+                       break;
+
                return 0;
        case FIO_Q_QUEUED:
                /*
@@ -1293,7 +1303,7 @@ static bool keep_running(struct thread_data *td)
                if (diff < td_max_bs(td))
                        return false;
 
-               if (fio_files_done(td))
+               if (fio_files_done(td) && !td->o.io_limit)
                        return false;
 
                return true;
@@ -2130,7 +2140,7 @@ reap:
                        if (waitee_running(td)) {
                                dprint(FD_PROCESS, "%s: waiting for %s\n",
                                                td->o.name, td->o.wait_for);
-                               break;
+                               continue;
                        }
 
                        init_disk_util(td);