[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>
This commit is contained in:
Jeff Dike 2005-06-25 14:55:23 -07:00 committed by Linus Torvalds
parent a6f4e3cf75
commit 026549d284
2 changed files with 4 additions and 6 deletions

View File

@ -69,7 +69,6 @@ static __init void do_uml_initcalls(void)
static void last_ditch_exit(int sig) static void last_ditch_exit(int sig)
{ {
kmalloc_ok = 0;
signal(SIGINT, SIG_DFL); signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL); signal(SIGTERM, SIG_DFL);
signal(SIGHUP, SIG_DFL); signal(SIGHUP, SIG_DFL);

View File

@ -38,14 +38,14 @@ static void kill_off_processes(void)
void uml_cleanup(void) void uml_cleanup(void)
{ {
kill_off_processes(); kmalloc_ok = 0;
do_uml_exitcalls(); do_uml_exitcalls();
kill_off_processes();
} }
void machine_restart(char * __unused) void machine_restart(char * __unused)
{ {
do_uml_exitcalls(); uml_cleanup();
kill_off_processes();
CHOOSE_MODE(reboot_tt(), reboot_skas()); CHOOSE_MODE(reboot_tt(), reboot_skas());
} }
@ -53,8 +53,7 @@ EXPORT_SYMBOL(machine_restart);
void machine_power_off(void) void machine_power_off(void)
{ {
do_uml_exitcalls(); uml_cleanup();
kill_off_processes();
CHOOSE_MODE(halt_tt(), halt_skas()); CHOOSE_MODE(halt_tt(), halt_skas());
} }