From dc4bffb8bc225584141ce5ec2059966e87fb6b51 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 4 Mar 2016 15:34:27 -0700 Subject: [PATCH] options: clean number of zones if we fail parsing Leaves us in a cleaner state, since the zone generation will never attempt to touch uninitialized data then. Signed-off-by: Jens Axboe --- options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index a222b190..3ae09064 100644 --- 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; } -- 2.25.1