From 8847ae4cd2e3d0d73dd7d7c93c5d6da96b71d174 Mon Sep 17 00:00:00 2001 From: Justin Eno Date: Tue, 10 Oct 2017 11:54:54 -0600 Subject: [PATCH] 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 --- backend.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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++; -- 2.25.1