X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=parse.c;h=745056bdc8186e54743d2fb688df926084c91853;hp=7912212ecda47594bac999e8abbecdacaf81aeb1;hb=0f38bbef532ef9da0d43382dca58a20e57c63dc1;hpb=92330695e64a42fd5dc54a6970a4b8122d3cd80e diff --git a/parse.c b/parse.c index 7912212e..745056bd 100644 --- a/parse.c +++ b/parse.c @@ -17,6 +17,7 @@ #include "options.h" #include "minmax.h" #include "lib/ieee754.h" +#include "lib/pow2.h" #ifdef CONFIG_ARITHMETIC #include "y.tab.h" @@ -521,6 +522,10 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, if (ret) break; + if (o->pow2 && !is_power_of_2(ull)) { + log_err("%s: must be a power-of-2\n", o->name); + return 1; + } if (o->maxval && ull > o->maxval) { log_err("max value out of range: %llu"