[PATCH] Defer engine ops verification check
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 2aeb6f72a5b196e3052876b27c24fd266db90cfe..61fd098958704473113dfa5cb6a76c795ce7f8a7 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -47,6 +47,7 @@ int temp_stall_ts;
 
 static volatile int startup_sem;
 static volatile int fio_abort;
+static int exit_value;
 
 struct io_log *agg_io_log[2];
 
@@ -382,7 +383,7 @@ static void do_io(struct thread_data *td)
 
        td_set_runstate(td, TD_RUNNING);
 
-       while (td->this_io_bytes[td->ddir] < td->io_size) {
+       while ((td->this_io_bytes[0] + td->this_io_bytes[1]) < td->io_size) {
                struct timespec *timeout;
                int min_evts = 0;
                struct io_u *io_u;
@@ -811,6 +812,9 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
                        continue;
                }
 
+               if (td->error)
+                       exit_value++;
+
                td_set_runstate(td, TD_REAPED);
 
                if (td->use_thread) {
@@ -1045,5 +1049,5 @@ int main(int argc, char *argv[])
                }
        }
 
-       return 0;
+       return exit_value;
 }