From: Lai Jiangshan Date: Tue, 19 Mar 2013 19:28:21 +0000 (+0800) Subject: workqueue: avoid false negative in assert_manager_or_pool_lock() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=519e3c1163ce2b2d510b76b0f5b374198f9378f3;p=openwrt%2Fstaging%2Fblogic.git 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: Lai Jiangshan Signed-off-by: Tejun Heo --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b6c5a524d7c4..47f258799bf2 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -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