diff options
author | Jeff Dike <jdike@addtoit.com> | 2005-06-26 01:55:23 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-26 03:24:35 +0400 |
commit | 026549d28469f7d4ca7e5a4707f0d2dc4f2c164c (patch) | |
tree | c616d69c9f70c9fdecae42a3d97009572cc82e07 /arch/um | |
parent | a6f4e3cf75538a75ee4fab620e3c8466f2154458 (diff) | |
download | linux-026549d28469f7d4ca7e5a4707f0d2dc4f2c164c.tar.xz |
[PATCH] uml: always disable kmalloc during shutdown
kmalloc wasn't being disabled during panic. This patch ensures that, no
matter how UML is exiting, it is disabled. This matters because part of the
cleanup is to remove the umid file, which involves readdir, which calls
malloc. This must map to libc malloc, rather than kmalloc or vmalloc.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/kernel/main.c | 1 | ||||
-rw-r--r-- | arch/um/kernel/reboot.c | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c index e59f58152678..1e1a87f1c510 100644 --- a/arch/um/kernel/main.c +++ b/arch/um/kernel/main.c @@ -69,7 +69,6 @@ static __init void do_uml_initcalls(void) static void last_ditch_exit(int sig) { - kmalloc_ok = 0; signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); signal(SIGHUP, SIG_DFL); diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 207f89d74908..fcec51da1d37 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c @@ -38,14 +38,14 @@ static void kill_off_processes(void) void uml_cleanup(void) { - kill_off_processes(); + kmalloc_ok = 0; do_uml_exitcalls(); + kill_off_processes(); } void machine_restart(char * __unused) { - do_uml_exitcalls(); - kill_off_processes(); + uml_cleanup(); CHOOSE_MODE(reboot_tt(), reboot_skas()); } @@ -53,8 +53,7 @@ EXPORT_SYMBOL(machine_restart); void machine_power_off(void) { - do_uml_exitcalls(); - kill_off_processes(); + uml_cleanup(); CHOOSE_MODE(halt_tt(), halt_skas()); } |