Warn more gently if the kernel is too old for io scheduler switching
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 89cc5996ca8854c9b9c655a232a366e8d278c9d7..160d533583b6850c30bacbd98e1ef345db5c7680 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -662,7 +662,11 @@ static int switch_ioscheduler(struct thread_data *td)
 
        f = fopen(tmp, "r+");
        if (!f) {
-               td_verror(td, errno, "fopen");
+               if (errno == ENOENT) {
+                       log_err("fio: os or kernel doesn't support IO scheduler switching\n");
+                       return 0;
+               }
+               td_verror(td, errno, "fopen iosched");
                return 1;
        }
 
@@ -990,6 +994,7 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
                /*
                 * thread is not dead, continue
                 */
+               pending++;
                continue;
 reaped:
                if (td->o.use_thread) {
@@ -1002,6 +1007,7 @@ reaped:
                (*nr_running)--;
                (*m_rate) -= td->o.ratemin;
                (*t_rate) -= td->o.rate;
+               pending--;
 
                if (td->error)
                        exit_value++;