summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-06-09 15:50:30 -0700
committerDavid S. Miller <davem@davemloft.net>2008-06-09 15:50:30 -0700
commit7b9d1b22a382aa221018c19880ee22c44467feec (patch)
tree392d015d192d3bddc0d0a2dfd4e2f027d26c09f2
parentf1494ed1d318542baa9480cfd44d040a92635129 (diff)
downloadlinux-3.10-7b9d1b22a382aa221018c19880ee22c44467feec.tar.gz
linux-3.10-7b9d1b22a382aa221018c19880ee22c44467feec.tar.bz2
linux-3.10-7b9d1b22a382aa221018c19880ee22c44467feec.zip
iucv: prevent cpu hotplug when walking cpu_online_map.
The code used preempt_disable() to prevent cpu hotplug, however that doesn't protect for cpus being added. So use get_online_cpus() instead. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/iucv/iucv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 2d43175b0cd..531a206ce7a 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -474,14 +474,14 @@ static void iucv_setmask_mp(void)
{
int cpu;
- preempt_disable();
+ get_online_cpus();
for_each_online_cpu(cpu)
/* Enable all cpus with a declared buffer. */
if (cpu_isset(cpu, iucv_buffer_cpumask) &&
!cpu_isset(cpu, iucv_irq_cpumask))
smp_call_function_single(cpu, iucv_allow_cpu,
NULL, 0, 1);
- preempt_enable();
+ put_online_cpus();
}
/**
@@ -521,16 +521,17 @@ static int iucv_enable(void)
goto out;
/* Declare per cpu buffers. */
rc = -EIO;
- preempt_disable();
+ get_online_cpus();
for_each_online_cpu(cpu)
smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1);
- preempt_enable();
if (cpus_empty(iucv_buffer_cpumask))
/* No cpu could declare an iucv buffer. */
goto out_path;
+ put_online_cpus();
return 0;
out_path:
+ put_online_cpus();
kfree(iucv_path_table);
out:
return rc;
@@ -545,7 +546,9 @@ out:
*/
static void iucv_disable(void)
{
+ get_online_cpus();
on_each_cpu(iucv_retrieve_cpu, NULL, 0, 1);
+ put_online_cpus();
kfree(iucv_path_table);
}