backend: don't dereference ->io_ops in reap_threads()
authorJustin Eno <jeno@micron.com>
Tue, 10 Oct 2017 17:54:54 +0000 (11:54 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Oct 2017 17:54:54 +0000 (11:54 -0600)
Without some type of mutex, td->io_ps cannot be dereferenced safely in
reap_threads().

Signed-off-by: Justin Eno <jeno@micron.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c

index ba6f585..d98e5fe 100644 (file)
--- 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++;