options: fix single use if / for bssplit
authorJens Axboe <axboe@fb.com>
Tue, 16 Sep 2014 00:51:32 +0000 (18:51 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 16 Sep 2014 00:51:32 +0000 (18:51 -0600)
It was buggy in that it did not extend to 100%, if nobody else
was part of the group.

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

index bc07885d757259b19313f22eaf1a54c8f9809a4f..ce955133eff6ddc3beda8ddcdd8af02725b7b621 100644 (file)
--- a/options.c
+++ b/options.c
@@ -133,7 +133,7 @@ static int bssplit_ddir(struct thread_options *o, int ddir, char *str)
                        perc += bsp->perc;
        }
 
-       if (perc > 100) {
+       if (perc > 100 && perc_missing > 1) {
                log_err("fio: bssplit percentages add to more than 100%%\n");
                free(bssplit);
                return 1;
@@ -143,6 +143,8 @@ static int bssplit_ddir(struct thread_options *o, int ddir, char *str)
         * them.
         */
        if (perc_missing) {
+               if (perc_missing == 1)
+                       perc = 100;
                for (i = 0; i < o->bssplit_nr[ddir]; i++) {
                        struct bssplit *bsp = &bssplit[i];