ioengine_load will try to load a given engine and if it doesn't match
the current one (default is always psync), it will remove the current
one and try again.
This makes sense when the engine is loaded successfully, but if it's
not, we try to load it twice for no reason.
Fix by failing if we were unable to load requested engine and not
retrying.
Signed-off-by: Yigal Korman <ykorman@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
*/
dlhandle = td->io_ops_dlhandle;
ops = load_ioengine(td);
+ if (!ops)
+ goto fail;
+
if (ops == td->io_ops && dlhandle == td->io_ops_dlhandle) {
if (dlhandle)
dlclose(dlhandle);
}
td->io_ops = load_ioengine(td);
- if (!td->io_ops) {
- log_err("fio: failed to load engine\n");
- return 1;
- }
+ if (!td->io_ops)
+ goto fail;
if (td->io_ops->option_struct_size && td->io_ops->options) {
/*
td_set_ioengine_flags(td);
return 0;
+
+fail:
+ log_err("fio: failed to load engine\n");
+ return 1;
+
}
static void init_flags(struct thread_data *td)