diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2013-03-19 15:28:21 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-03-20 14:21:34 -0400 |
commit | 519e3c1163ce2b2d510b76b0f5b374198f9378f3 (patch) | |
tree | 57fc8b79a3e9a64517a328dd626a4df2b2d0227f /kernel/workqueue.c | |
parent | 881094532e2a27406a5f06f839087bd152a8a494 (diff) |
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 <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, | |||
305 | 305 | ||
306 | #ifdef CONFIG_LOCKDEP | 306 | #ifdef CONFIG_LOCKDEP |
307 | #define assert_manager_or_pool_lock(pool) \ | 307 | #define assert_manager_or_pool_lock(pool) \ |
308 | WARN_ONCE(!lockdep_is_held(&(pool)->manager_mutex) && \ | 308 | WARN_ONCE(debug_locks && \ |
309 | !lockdep_is_held(&(pool)->manager_mutex) && \ | ||
309 | !lockdep_is_held(&(pool)->lock), \ | 310 | !lockdep_is_held(&(pool)->lock), \ |
310 | "pool->manager_mutex or ->lock should be held") | 311 | "pool->manager_mutex or ->lock should be held") |
311 | #else | 312 | #else |