Skip to content

Commit

Permalink
[PATCH] avoid resursive oopses
Browse files Browse the repository at this point in the history
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 <alexn@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Alexander Nyberg authored and Linus Torvalds committed Jun 23, 2005
1 parent 5f45f1a commit df164db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,17 @@ fastcall NORET_TYPE void do_exit(long code)
ptrace_notify((PTRACE_EVENT_EXIT << 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->flags & PF_EXITING)) {
printk(KERN_ALERT
"Fixing recursive fault but reboot is needed!\n");
set_current_state(TASK_UNINTERRUPTIBLE);
schedule();
}

tsk->flags |= PF_EXITING;

/*
Expand Down

0 comments on commit df164db

Please sign in to comment.