Fix bug in bssplit parsing
authorKenneth Waters <kwaters@google.com>
Thu, 15 Oct 2009 05:08:48 +0000 (07:08 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 15 Oct 2009 05:08:48 +0000 (07:08 +0200)
I found a bug is bssplit parsing in bssplit_ddir() when trying to use
FIO on an ARM platform.  It looks like str_to_decimal() takes a "void
*" as its fourth argument, which it passes to get_multi_bytes(), which
is passes to fio_get_kb_base(), which casts it to a "struct
thread_data *".  bssplit_ddir() is passing in "struct thread_data **",
which I think is causing fio_get_kb_base() to go paw around in the
stack; I believe the different stack layouts between ARM and x86 is
causing me to see this problem.  The first change that introduces this
bug seems to be d6978a3242daad9cb7b0710b724f19225d1ed7e2.

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

index 549775c57ee8925ccc2ee6767bea75d7d30f455b..b5abd74287f24e244a069ba2bb4be65f168664a0 100644 (file)
--- a/options.c
+++ b/options.c
@@ -82,7 +82,7 @@ static int bssplit_ddir(struct thread_data *td, int ddir, char *str)
                } else
                        perc = -1;
 
                } else
                        perc = -1;
 
-               if (str_to_decimal(fname, &val, 1, &td)) {
+               if (str_to_decimal(fname, &val, 1, td)) {
                        log_err("fio: bssplit conversion failed\n");
                        free(td->o.bssplit);
                        return 1;
                        log_err("fio: bssplit conversion failed\n");
                        free(td->o.bssplit);
                        return 1;