From: Justin Eno Date: Tue, 10 Oct 2017 17:54:54 +0000 (-0600) Subject: backend: don't dereference ->io_ops in reap_threads() X-Git-Tag: fio-3.2~46 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8847ae4cd2e3d0d73dd7d7c93c5d6da96b71d174 backend: don't dereference ->io_ops in reap_threads() Without some type of mutex, td->io_ps cannot be dereferenced safely in reap_threads(). Signed-off-by: Justin Eno Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index ba6f5854..d98e5fe4 100644 --- a/backend.c +++ b/backend.c @@ -1929,11 +1929,7 @@ static void reap_threads(unsigned int *nr_running, uint64_t *t_rate, for_each_td(td, i) { int flags = 0; - /* - * ->io_ops is NULL for a thread that has closed its - * io engine - */ - if (td->io_ops && !strcmp(td->io_ops->name, "cpuio")) + if (!strcmp(td->o.ioengine, "cpuio")) cputhreads++; else realthreads++;