The following changes since commit 0f805c00a7073293f4cceb041a6af0b9f388e6f8: Fix unsigned integer overflow in IO buffer allocator (2011-03-25 21:36:28 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (3): parser: get rid of useless is_time variable Get rid of mixed rw and verify warning Fix parser bug dealing with range options and postfix init.c | 6 ------ parse.c | 37 ++++++++++++++++++------------------- 2 files changed, 18 insertions(+), 25 deletions(-) --- Diff of recent changes: diff --git a/init.c b/init.c index 65d573a..327a3c5 100644 --- a/init.c +++ b/init.c @@ -376,12 +376,6 @@ static int fixup_options(struct thread_data *td) o->size = -1ULL; if (o->verify != VERIFY_NONE) { - if (td_rw(td)) { - log_info("fio: mixed read/write workload with verify. " - "May not work as expected, unless you " - "pre-populated the file\n"); - ret = warnings_fatal; - } if (td_write(td) && o->do_verify && o->numjobs > 1) { log_info("Multiple writers may overwrite blocks that " "belong to other jobs. This can cause " diff --git a/parse.c b/parse.c index bb138e5..585fb7e 100644 --- a/parse.c +++ b/parse.c @@ -168,19 +168,20 @@ static unsigned long long __get_mult_bytes(const char *p, void *data) static unsigned long long get_mult_bytes(const char *str, int len, void *data) { - const char *p; + const char *p = str; if (len < 2) return __get_mult_bytes(str, data); - /* - * if the last char is 'b' or 'B', the user likely used - * "1gb" instead of just "1g". If the second to last is also - * a letter, adjust. - */ - p = str + len - 1; - while (isalpha(*(p - 1))) - p--; + /* + * Go forward until we hit a non-digit + */ + while ((p - str) <= len) { + if (!isdigit(*p)) + break; + p++; + } + if (!isalpha(*p)) p = NULL; @@ -309,7 +310,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, long long ull, *ullp; long ul1, ul2; char **cp; - int ret = 0, is_time = 0; + int ret = 0; dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name, o->type, ptr); @@ -357,17 +358,14 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, ret = fn(data, ptr); break; } - case FIO_OPT_STR_VAL_TIME: - is_time = 1; - case FIO_OPT_INT: - case FIO_OPT_STR_VAL: { - fio_opt_str_val_fn *fn = o->cb; + case FIO_OPT_STR_VAL_TIME: { + fio_opt_str_val_fn *fn; - if (is_time) - ret = check_str_time(ptr, &ull); - else - ret = check_str_bytes(ptr, &ull, data); + ret = check_str_time(ptr, &ull); + case FIO_OPT_INT: + case FIO_OPT_STR_VAL: + ret = check_str_bytes(ptr, &ull, data); if (ret) break; @@ -382,6 +380,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, return 1; } + fn = o->cb; if (fn) ret = fn(data, &ull); else { -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html