Skip to content

Commit

Permalink
workqueue: avoid false negative in assert_manager_or_pool_lock()
Browse files Browse the repository at this point in the history
If lockdep complains something for other subsystem, lockdep_is_held()
can be false negative, so we need to also test debug_locks before
triggering WARN.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Lai Jiangshan authored and Tejun Heo committed Mar 20, 2013
1 parent 8810945 commit 519e3c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ static void copy_workqueue_attrs(struct workqueue_attrs *to,

#ifdef CONFIG_LOCKDEP
#define assert_manager_or_pool_lock(pool) \
WARN_ONCE(!lockdep_is_held(&(pool)->manager_mutex) && \
WARN_ONCE(debug_locks && \
!lockdep_is_held(&(pool)->manager_mutex) && \
!lockdep_is_held(&(pool)->lock), \
"pool->manager_mutex or ->lock should be held")
#else
Expand Down

0 comments on commit 519e3c1

Please sign in to comment.