Warn when seeing a job option outside of a job section
authorJens Axboe <jens.axboe@oracle.com>
Thu, 29 Mar 2007 22:12:57 +0000 (14:12 -0800)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 29 Mar 2007 22:12:57 +0000 (14:12 -0800)
Otherwise it's easy to screw up because fio will have ignored
a number of options. This has happened to me with bad pasting
of job files before, missing the starting '[' bracket.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
init.c

diff --git a/init.c b/init.c
index 51b9fa1d04a93531d7b0ca6de1005d68376e5796..4fd41b7dff1d14825df5fa95230b284dffeb4dd9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -547,11 +547,14 @@ static int parse_jobs_ini(char *file, int stonewall_flag)
                        break;
 
                strip_blank_front(&p);
+               strip_blank_end(p);
 
                if (is_empty_or_comment(p))
                        continue;
-               if (sscanf(p, "[%255s]", name) != 1)
+               if (sscanf(p, "[%255s]", name) != 1) {
+                       log_err("fio: option <%s> outside of job section\n", p);
                        continue;
+               }
 
                global = !strncmp(name, "global", 6);