backend: initialize io engine before io_u buffers
authorJens Axboe <axboe@kernel.dk>
Wed, 21 Nov 2018 02:42:19 +0000 (19:42 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 21 Nov 2018 02:42:19 +0000 (19:42 -0700)
Otherwise we call io_ops->io_u_init() before the IO scheduler is
setup, which is somewhat backwards.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c

index d64cc9922114b48cc241f9e3b6d67e52767dabc7..2f103b3abb15f7d25e45d82f536b925075518bdd 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1698,6 +1698,9 @@ static void *thread_main(void *data)
        if (!init_iolog(td))
                goto err;
 
+       if (td_io_init(td))
+               goto err;
+
        if (init_io_u(td))
                goto err;
 
@@ -1728,9 +1731,6 @@ static void *thread_main(void *data)
        if (!o->create_serialize && setup_files(td))
                goto err;
 
-       if (td_io_init(td))
-               goto err;
-
        if (!init_random_map(td))
                goto err;