Fix fill_device with queue depth higher than 1
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index a737a310df821b62978fc420a36968d7c64c8324..5ea1a2c32fc3d44edda83d910c8d11f8015cc1c9 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -114,18 +114,12 @@ static void terminate_threads(int group_id)
        }
 }
 
-/*
- * Happens on thread runs with ctrl-c, ignore our own SIGQUIT
- */
-static void sig_quit(int sig)
-{
-}
-
 static void sig_int(int sig)
 {
        if (threads) {
                log_info("\nfio: terminating on signal %d\n", sig);
                fflush(stdout);
+               exit_value = 128;
                terminate_threads(TERMINATE_ALL);
        }
 }
@@ -177,7 +171,7 @@ static void set_sig_handlers(void)
        sigaction(SIGINT, &act, NULL);
 
        memset(&act, 0, sizeof(act));
-       act.sa_handler = sig_quit;
+       act.sa_handler = sig_int;
        act.sa_flags = SA_RESTART;
        sigaction(SIGTERM, &act, NULL);
 }
@@ -186,7 +180,7 @@ static void set_sig_handlers(void)
  * Check if we are above the minimum rate given.
  */
 static int __check_min_rate(struct thread_data *td, struct timeval *now,
-                           enum td_ddir ddir)
+                           enum fio_ddir ddir)
 {
        unsigned long long bytes = 0;
        unsigned long iops = 0;
@@ -766,8 +760,11 @@ sync_done:
                struct fio_file *f;
 
                i = td->cur_depth;
-               if (i)
+               if (i) {
                        ret = io_u_queued_complete(td, i, NULL);
+                       if (td->o.fill_device && td->error == ENOSPC)
+                               td->error = 0;
+               }
 
                if (should_fsync(td) && td->o.end_fsync) {
                        td_set_runstate(td, TD_FSYNCING);