Commit 9948ff55 authored by Zqiang's avatar Zqiang Committed by Greg Kroah-Hartman
Browse files

workqueue: Move the position of debug_work_activate() in __queue_work()

[ Upstream commit 0687c66b ]

The debug_work_activate() is called on the premise that
the work can be inserted, because if wq be in WQ_DRAINING
status, insert work may be failed.

Fixes: e41e704b

 ("workqueue: improve destroy_workqueue() debuggability")
Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
Reviewed-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0834c021
linux-4.14.y Tags unavailable
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -1379,7 +1379,6 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
*/
WARN_ON_ONCE(!irqs_disabled());
debug_work_activate(work);
/* if draining, only works from the same workqueue are allowed */
if (unlikely(wq->flags & __WQ_DRAINING) &&
......@@ -1462,6 +1461,7 @@ static void __queue_work(int cpu, struct workqueue_struct *wq,
worklist = &pwq->delayed_works;
}
debug_work_activate(work);
insert_work(pwq, work, worklist, work_flags);
spin_unlock(&pwq->pool->lock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment