Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 519e3c11 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Tejun Heo
Browse files

workqueue: avoid false negative in assert_manager_or_pool_lock()



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: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 88109453
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -305,7 +305,8 @@ static void copy_workqueue_attrs(struct workqueue_attrs *to,


#ifdef CONFIG_LOCKDEP
#ifdef CONFIG_LOCKDEP
#define assert_manager_or_pool_lock(pool)				\
#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),			\
		  !lockdep_is_held(&(pool)->lock),			\
		  "pool->manager_mutex or ->lock should be held")
		  "pool->manager_mutex or ->lock should be held")
#else
#else