Skip to content

Commit 4ce6494

Browse files
mitatorvalds
authored andcommitted
stop_machine: convert cpu notifier to return encapsulate errno value
In commit e6bde73 ("cpu-hotplug: return better errno on cpu hotplug failure"), the cpu notifier can return an encapsulated errno value. This converts the cpu notifier to return an encapsulated errno value for stop_machine(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ca51c5a commit 4ce6494

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎kernel/stop_machine.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,
304304
p = kthread_create(cpu_stopper_thread, stopper, "migration/%d",
305305
cpu);
306306
if (IS_ERR(p))
307-
return NOTIFY_BAD;
307+
return notifier_from_errno(PTR_ERR(p));
308308
get_task_struct(p);
309309
kthread_bind(p, cpu);
310310
sched_set_stop_task(cpu, p);
@@ -372,7 +372,7 @@ static int __init cpu_stop_init(void)
372372
/* start one for the boot cpu */
373373
err = cpu_stop_cpu_callback(&cpu_stop_cpu_notifier, CPU_UP_PREPARE,
374374
bcpu);
375-
BUG_ON(err == NOTIFY_BAD);
375+
BUG_ON(err != NOTIFY_OK);
376376
cpu_stop_cpu_callback(&cpu_stop_cpu_notifier, CPU_ONLINE, bcpu);
377377
register_cpu_notifier(&cpu_stop_cpu_notifier);
378378

0 commit comments

Comments
 (0)