options: clean number of zones if we fail parsing
authorJens Axboe <axboe@fb.com>
Fri, 4 Mar 2016 22:34:27 +0000 (15:34 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 4 Mar 2016 22:34:27 +0000 (15:34 -0700)
Leaves us in a cleaner state, since the zone generation will never
attempt to touch uninitialized data then.

Signed-off-by: Jens Axboe <axboe@fb.com>
options.c

index a222b190f159e8d6b3dca0ef93a72109c8ee6aab..3ae090640bd1119c5561f2c5fbf49a2de439cb5d 100644 (file)
--- a/options.c
+++ b/options.c
@@ -867,7 +867,6 @@ static void td_zone_gen_index(struct thread_data *td)
                __td_zone_gen_index(td, i);
 }
 
-
 static int parse_zoned_distribution(struct thread_data *td, const char *input)
 {
        char *str, *p, *odir, *ddir;
@@ -940,6 +939,10 @@ static int parse_zoned_distribution(struct thread_data *td, const char *input)
 
        if (!ret)
                td_zone_gen_index(td);
+       else {
+               for (i = 0; i < DDIR_RWDIR_CNT; i++)
+                       td->o.zone_split_nr[i] = 0;
+       }
 
        return ret;
 }