diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2010-05-26 23:43:29 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 18:12:47 +0200 |
commit | e6bde73b07edeb703d4c89c1daabc09c303de11f (patch) | |
tree | 9b60a3fc2ce002b26e46611357cb5529795e7ac5 /kernel/rtmutex-tester.c | |
parent | cpu-hotplug: introduce cpu_notify(), __cpu_notify(), cpu_notify_nofail() (diff) | |
download | linux-e6bde73b07edeb703d4c89c1daabc09c303de11f.tar.xz linux-e6bde73b07edeb703d4c89c1daabc09c303de11f.zip |
cpu-hotplug: return better errno on cpu hotplug failure
Currently, onlining or offlining a CPU failure by one of the cpu notifiers
error always cause -EINVAL error. (i.e. writing 0 or 1 to
/sys/devices/system/cpu/cpuX/online gets EINVAL)
To get better error reporting rather than always getting -EINVAL, This
changes cpu_notify() to return -errno value with notifier_to_errno() and
fix the callers. Now that cpu notifiers can return encapsulate errno
value.
Currently, all cpu hotplug notifiers return NOTIFY_OK, NOTIFY_BAD, or
NOTIFY_DONE. So cpu_notify() can returns 0 or -EPERM with this change for
now.
(notifier_to_errno(NOTIFY_OK) == 0, notifier_to_errno(NOTIFY_DONE) == 0,
notifier_to_errno(NOTIFY_BAD) == -EPERM)
Forthcoming patches convert several cpu notifiers to return encapsulate
errno value with notifier_from_errno().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/rtmutex-tester.c')
0 files changed, 0 insertions, 0 deletions