diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 2ef2ad540201..9d1b10ed0135 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -72,6 +72,11 @@ repeat: | |||
72 | BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children)); | 72 | BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children)); |
73 | __exit_signal(p); | 73 | __exit_signal(p); |
74 | __exit_sighand(p); | 74 | __exit_sighand(p); |
75 | /* | ||
76 | * Note that the fastpath in sys_times depends on __exit_signal having | ||
77 | * updated the counters before a task is removed from the tasklist of | ||
78 | * the process by __unhash_process. | ||
79 | */ | ||
75 | __unhash_process(p); | 80 | __unhash_process(p); |
76 | 81 | ||
77 | /* | 82 | /* |
@@ -779,6 +784,8 @@ fastcall NORET_TYPE void do_exit(long code) | |||
779 | 784 | ||
780 | profile_task_exit(tsk); | 785 | profile_task_exit(tsk); |
781 | 786 | ||
787 | WARN_ON(atomic_read(&tsk->fs_excl)); | ||
788 | |||
782 | if (unlikely(in_interrupt())) | 789 | if (unlikely(in_interrupt())) |
783 | panic("Aiee, killing interrupt handler!"); | 790 | panic("Aiee, killing interrupt handler!"); |
784 | if (unlikely(!tsk->pid)) | 791 | if (unlikely(!tsk->pid)) |
@@ -793,6 +800,17 @@ fastcall NORET_TYPE void do_exit(long code) | |||
793 | ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP); | 800 | ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP); |
794 | } | 801 | } |
795 | 802 | ||
803 | /* | ||
804 | * We're taking recursive faults here in do_exit. Safest is to just | ||
805 | * leave this task alone and wait for reboot. | ||
806 | */ | ||
807 | if (unlikely(tsk->flags & PF_EXITING)) { | ||
808 | printk(KERN_ALERT | ||
809 | "Fixing recursive fault but reboot is needed!\n"); | ||
810 | set_current_state(TASK_UNINTERRUPTIBLE); | ||
811 | schedule(); | ||
812 | } | ||
813 | |||
796 | tsk->flags |= PF_EXITING; | 814 | tsk->flags |= PF_EXITING; |
797 | 815 | ||
798 | /* | 816 | /* |