Check if sysfs ioscheduler entry is "none"
[fio.git] / backend.c
index 58727114ab8fb86878bb73c1bc8c7293cc58d37b..6bf5d679a5898d998f8d5efeb0ce3b9b46b99d81 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1331,6 +1331,14 @@ static int switch_ioscheduler(struct thread_data *td)
         */
        tmp[strlen(tmp) - 1] = '\0';
 
+       /*
+        * Write to "none" entry doesn't fail, so check the result here.
+        */
+       if (!strcmp(tmp, "none")) {
+               log_err("fio: io scheduler is not tunable\n");
+               fclose(f);
+               return 0;
+       }
 
        sprintf(tmp2, "[%s]", td->o.ioscheduler);
        if (!strstr(tmp, tmp2)) {