diff options
author | Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> | 2006-10-28 13:38:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-28 14:30:55 -0400 |
commit | 8fa1d7d3b2c51594c0f3aa151983dd51f605e07d (patch) | |
tree | 8fbc0037f98d1cc3201ca1a816b42ad87930e2db /kernel | |
parent | bb1d860551c4307b1a7ee9a21b120319075e987e (diff) |
[PATCH] cpu-hotplug: release `workqueue_mutex' properly on CPU hot-remove
_cpu_down() acquires `workqueue_mutex' on its process, but doen't release it
if __cpu_disable() fails.
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpu.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 27dd3ee47099..663c920b2234 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -150,18 +150,18 @@ static int _cpu_down(unsigned int cpu) | |||
150 | p = __stop_machine_run(take_cpu_down, NULL, cpu); | 150 | p = __stop_machine_run(take_cpu_down, NULL, cpu); |
151 | mutex_unlock(&cpu_bitmask_lock); | 151 | mutex_unlock(&cpu_bitmask_lock); |
152 | 152 | ||
153 | if (IS_ERR(p)) { | 153 | if (IS_ERR(p) || cpu_online(cpu)) { |
154 | /* CPU didn't die: tell everyone. Can't complain. */ | 154 | /* CPU didn't die: tell everyone. Can't complain. */ |
155 | if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, | 155 | if (raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED, |
156 | (void *)(long)cpu) == NOTIFY_BAD) | 156 | (void *)(long)cpu) == NOTIFY_BAD) |
157 | BUG(); | 157 | BUG(); |
158 | 158 | ||
159 | err = PTR_ERR(p); | 159 | if (IS_ERR(p)) { |
160 | goto out_allowed; | 160 | err = PTR_ERR(p); |
161 | } | 161 | goto out_allowed; |
162 | 162 | } | |
163 | if (cpu_online(cpu)) | ||
164 | goto out_thread; | 163 | goto out_thread; |
164 | } | ||
165 | 165 | ||
166 | /* Wait for it to sleep (leaving idle task). */ | 166 | /* Wait for it to sleep (leaving idle task). */ |
167 | while (!idle_cpu(cpu)) | 167 | while (!idle_cpu(cpu)) |