fix load_ioengine() not to support no "external:" prefix
authorTomohiro Kusumi <tkusumi@tuxera.com>
Thu, 31 Aug 2017 20:13:07 +0000 (23:13 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Aug 2017 20:19:58 +0000 (14:19 -0600)
commit81647a9a229b92635062e0a1ee570997634b7848
tree40b717aa8629221cc44533649ed40064476364e2
parent4fedf59af77492b2f9f70dedee6b2c7941ac1fe0
fix load_ioengine() not to support no "external:" prefix

To load ioengines, it should be done by either
 1) find the ioengine from the existing (static linked) ioengines or
 2) dlopen the path in case of external ioengine,

but not to do 2 if 1 failed, as fio doesn't expect an ioengine to be
dynamically loaded unless with "external:" prefix by design.

The current implementation (i.e. do 2 if 1 failed) happened to have
been able to load an external ioengine with below syntax without
"external:" prefix, but this is a bug rather than a feature.

(--)ioengine=./engines/skeleton_external.so

The design of the external ioengine option since below commits in 2007
 7b395ca5('Prefix external io engine loading with 'external'')
 8a7bd877('Document loading external io engines')
is to use "external:/path/to/so" syntax.

This commit fixes above bug, which also potentially avoids the case
where "/path/to/so" within the given "external:/path/to/so" happens
to match the existing name, though this is normally unlikely to happen.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
ioengines.c