From: Jens Axboe Date: Wed, 19 Aug 2020 13:12:11 +0000 (-0600) Subject: engines/windowsaio: fix silly thinky on IO thread creation X-Git-Tag: fio-3.23~28 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1dd90eec6cf5e68285dcab638b97a25f5f3018d4;p=fio.git engines/windowsaio: fix silly thinky on IO thread creation I inadvertently made the setup fail unless the affinity option was set, the intent was obviously to only run the affinitization if we asked for it. Fixes: 09c1aa8b3227 ("engines/windowsaio: only set IOCP thread affinity if specified") Signed-off-by: Jens Axboe --- diff --git a/engines/windowsaio.c b/engines/windowsaio.c index ff8b6e1b..5c7e7964 100644 --- a/engines/windowsaio.c +++ b/engines/windowsaio.c @@ -106,12 +106,10 @@ static int fio_windowsaio_init(struct thread_data *td) ctx->iocp = hFile; ctx->wd = wd; wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, &threadid); - - if (wd->iothread != NULL && - fio_option_is_set(&td->o, cpumask)) - fio_setaffinity(threadid, td->o.cpumask); - else + if (!wd->iothread) log_err("windowsaio: failed to create io completion thread\n"); + else if (fio_option_is_set(&td->o, cpumask)) + fio_setaffinity(threadid, td->o.cpumask); } if (rc || wd->iothread == NULL)