diff options
| author | Andrew Morton <akpm@osdl.org> | 2004-05-10 00:03:20 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-10 00:03:20 -0700 |
| commit | b4ad84fc91d47b7b6c2674abf776068a118a7726 (patch) | |
| tree | 83c14d163e283fc109fcc976d544eb9a40f2f1bc /kernel/workqueue.c | |
| parent | 7676bfa08ae93461715b3bfd9c093821c8baf049 (diff) | |
[PATCH] fix deadlock in create_workqueue()
Fix bug identified by Srivatsa Vaddagiri <vatsa@in.ibm.com>:
There's a deadlock in __create_workqueue when CONFIG_HOTPLUG_CPU is set. This
can happen when create_workqueue_thread fails to create a worker thread. In
that case, we call destroy_workqueue with cpu hotplug lock held.
destroy_workqueue however also attempts to take the same lock.
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 162aca1f4822..8c0be4dc39bb 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -334,6 +334,7 @@ struct workqueue_struct *__create_workqueue(const char *name, destroy = 1; } } + unlock_cpu_hotplug(); /* * Was there any error during startup? If yes then clean up: @@ -342,7 +343,6 @@ struct workqueue_struct *__create_workqueue(const char *name, destroy_workqueue(wq); wq = NULL; } - unlock_cpu_hotplug(); return wq; } |
