<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Alexander Nyberg &lt;alexn@dsv.su.se&gt;

Prevent recursive faults in do_exit() by leaving the task alone and wait
for reboot.  This may allow a more graceful shutdown and possibly save the
original oops.

Signed-off-by: Alexander Nyberg &lt;alexn@telia.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 kernel/exit.c |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -puN kernel/exit.c~avoid-recursive-oopses kernel/exit.c
--- 25/kernel/exit.c~avoid-recursive-oopses	2005-05-06 18:03:45.000000000 -0700
+++ 25-akpm/kernel/exit.c	2005-05-06 18:06:01.000000000 -0700
@@ -795,6 +795,17 @@ fastcall NORET_TYPE void do_exit(long co
 		ptrace_notify((PTRACE_EVENT_EXIT &lt;&lt; 8) | SIGTRAP);
 	}
 
+	/*
+	 * We're taking recursive faults here in do_exit. Safest is to just
+	 * leave this task alone and wait for reboot.
+	 */
+	if (unlikely(tsk-&gt;flags &amp; PF_EXITING)) {
+		printk(KERN_ALERT
+			"Fixing recursive fault but reboot is needed!\n");
+		set_current_state(TASK_UNINTERRUPTIBLE);
+		schedule();
+	}
+
 	tsk-&gt;flags |= PF_EXITING;
 
 	/*
_
</pre></body></html>