[PATCH] workqueue: missing NOT while checking if Workqueue is offline

From: Geraldo Nascimento
Date: Sat May 28 2022 - 16:07:19 EST


Greetings,

This is a one-character patch but very important as the kernel workqueue
__cancel_work_timer will cancel active work without the NOT operator
added.

During early boot wq_online is false so with the NOT added it will evaluate
to true. Conversely, after boot is done, workqueue is now true and we want
it to evaluate to false because otherwise it will cancel important work.

Signed-off-by: Geraldo Nascimento <geraldogabriel@xxxxxxxxx>

--- workqueue.c 2022-05-28 16:54:12.024176123 -0300
+++ workqueue.c 2022-05-28 16:54:37.698176135 -0300
@@ -3158,7 +3158,7 @@ static bool __cancel_work_timer(struct w
* This allows canceling during early boot. We know that @work
* isn't executing.
*/
- if (wq_online)
+ if (!wq_online)
__flush_work(work, true);

clear_work_data(work);