Warn more gently if the kernel is too old for io scheduler switching
authorJens Axboe <jens.axboe@oracle.com>
Mon, 16 Apr 2007 10:56:00 +0000 (12:56 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 16 Apr 2007 10:56:00 +0000 (12:56 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index edc6b495789d04e30e88ab520a9204cf37422887..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;
        }