diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-06-09 18:50:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-09 18:50:30 -0400 |
commit | 7b9d1b22a382aa221018c19880ee22c44467feec (patch) | |
tree | 392d015d192d3bddc0d0a2dfd4e2f027d26c09f2 /net | |
parent | f1494ed1d318542baa9480cfd44d040a92635129 (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/iucv/iucv.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 2d43175b0cdb..531a206ce7a6 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c | |||
@@ -474,14 +474,14 @@ static void iucv_setmask_mp(void) | |||
474 | { | 474 | { |
475 | int cpu; | 475 | int cpu; |
476 | 476 | ||
477 | preempt_disable(); | 477 | get_online_cpus(); |
478 | for_each_online_cpu(cpu) | 478 | for_each_online_cpu(cpu) |
479 | /* Enable all cpus with a declared buffer. */ | 479 | /* Enable all cpus with a declared buffer. */ |
480 | if (cpu_isset(cpu, iucv_buffer_cpumask) && | 480 | if (cpu_isset(cpu, iucv_buffer_cpumask) && |
481 | !cpu_isset(cpu, iucv_irq_cpumask)) | 481 | !cpu_isset(cpu, iucv_irq_cpumask)) |
482 | smp_call_function_single(cpu, iucv_allow_cpu, | 482 | smp_call_function_single(cpu, iucv_allow_cpu, |
483 | NULL, 0, 1); | 483 | NULL, 0, 1); |
484 | preempt_enable(); | 484 | put_online_cpus(); |
485 | } | 485 | } |
486 | 486 | ||
487 | /** | 487 | /** |
@@ -521,16 +521,17 @@ static int iucv_enable(void) | |||
521 | goto out; | 521 | goto out; |
522 | /* Declare per cpu buffers. */ | 522 | /* Declare per cpu buffers. */ |
523 | rc = -EIO; | 523 | rc = -EIO; |
524 | preempt_disable(); | 524 | get_online_cpus(); |
525 | for_each_online_cpu(cpu) | 525 | for_each_online_cpu(cpu) |
526 | smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1); | 526 | smp_call_function_single(cpu, iucv_declare_cpu, NULL, 0, 1); |
527 | preempt_enable(); | ||
528 | if (cpus_empty(iucv_buffer_cpumask)) | 527 | if (cpus_empty(iucv_buffer_cpumask)) |
529 | /* No cpu could declare an iucv buffer. */ | 528 | /* No cpu could declare an iucv buffer. */ |
530 | goto out_path; | 529 | goto out_path; |
530 | put_online_cpus(); | ||
531 | return 0; | 531 | return 0; |
532 | 532 | ||
533 | out_path: | 533 | out_path: |
534 | put_online_cpus(); | ||
534 | kfree(iucv_path_table); | 535 | kfree(iucv_path_table); |
535 | out: | 536 | out: |
536 | return rc; | 537 | return rc; |
@@ -545,7 +546,9 @@ out: | |||
545 | */ | 546 | */ |
546 | static void iucv_disable(void) | 547 | static void iucv_disable(void) |
547 | { | 548 | { |
549 | get_online_cpus(); | ||
548 | on_each_cpu(iucv_retrieve_cpu, NULL, 0, 1); | 550 | on_each_cpu(iucv_retrieve_cpu, NULL, 0, 1); |
551 | put_online_cpus(); | ||
549 | kfree(iucv_path_table); | 552 | kfree(iucv_path_table); |
550 | } | 553 | } |
551 | 554 | ||