From: Jens Axboe Date: Mon, 24 Oct 2016 16:51:04 +0000 (-0600) Subject: backend: end IO loop early, if the job is marked as terminated X-Git-Tag: fio-2.15~2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=49f0b8e0ce28deaa99379ef056cc5972a0b8694a;p=fio.git backend: end IO loop early, if the job is marked as terminated If we terminate a job, we don't want that job to attempt to grab resources that might already have been freed. Signed-off-by: Jens Axboe --- diff --git a/backend.c b/backend.c index 093b6a3a..f0927abf 100644 --- a/backend.c +++ b/backend.c @@ -1723,6 +1723,14 @@ static void *thread_main(void *data) } } + /* + * If we took too long to shut down, the main thread could + * already consider us reaped/exited. If that happens, break + * out and clean up. + */ + if (td->runstate >= TD_EXITED) + break; + clear_state = 1; /*