mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 5/8] UML - Always disable kmalloc during shutdown
@ 2005-06-20 18:51 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-06-20 18:51 UTC (permalink / raw)
  To: akpm, torvalds; +Cc: linux-kernel, user-mode-linux-devel

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>

Index: linux-2.6.12/arch/um/kernel/main.c
===================================================================
--- linux-2.6.12.orig/arch/um/kernel/main.c	2005-06-20 11:54:50.000000000 -0400
+++ linux-2.6.12/arch/um/kernel/main.c	2005-06-20 12:08:11.000000000 -0400
@@ -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);
Index: linux-2.6.12/arch/um/kernel/reboot.c
===================================================================
--- linux-2.6.12.orig/arch/um/kernel/reboot.c	2005-06-20 11:54:45.000000000 -0400
+++ linux-2.6.12/arch/um/kernel/reboot.c	2005-06-20 12:07:55.000000000 -0400
@@ -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());
 }
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-20 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-20 18:51 [PATCH 5/8] UML - Always disable kmalloc during shutdown Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®