fio: fix dlopen refcounting of dynamic engines
authorEric Sandeen <sandeen@redhat.com>
Mon, 25 Jan 2021 19:23:48 +0000 (13:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 21:03:58 +0000 (14:03 -0700)
commit48ff7df9daea86c82a572b0a840bb8371b6b1a29
tree19d2dcc104930c402bc403d4bc823b35e1103b88
parentf6931a1dd35896433c8cc2e10de51372a2c496c4
fio: fix dlopen refcounting of dynamic engines

ioengine_load() will dlclose the dynamic library if it matches one
that we've already got open, but this defeats the built-in refcounting
done by dlopen/dlclose.  As each thread exits, it calls free_ioengine(),
and this may do a final dlclose on a dynamic ioengine that is still
in use if we don't have the proper reference count.

Fix this by dropping the explicit dlclose of a "matching" dlopened
dynamic engine library, and let each dlclose decrement the refcount
on the engine library as is normal.

This also adds/modifies a couple of debug messages to help track this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c
ioengines.c