]> err.no Git - linux-2.6/blobdiff - kernel/exit.c
Auto-update from upstream
[linux-2.6] / kernel / exit.c
index 6d2089a1bce74614009acfb18f1e3b95458e90cf..4897977a1f4b950b98672782826fa80df34ba15a 100644 (file)
@@ -371,6 +371,12 @@ static inline void close_files(struct files_struct * files)
        struct fdtable *fdt;
 
        j = 0;
+
+       /*
+        * It is safe to dereference the fd table without RCU or
+        * ->file_lock because this is the last reference to the
+        * files structure.
+        */
        fdt = files_fdtable(files);
        for (;;) {
                unsigned long set;
@@ -819,14 +825,6 @@ fastcall NORET_TYPE void do_exit(long code)
 
        tsk->flags |= PF_EXITING;
 
-       /*
-        * Make sure we don't try to process any timer firings
-        * while we are already exiting.
-        */
-       tsk->it_virt_expires = cputime_zero;
-       tsk->it_prof_expires = cputime_zero;
-       tsk->it_sched_expires = 0;
-
        if (unlikely(in_atomic()))
                printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
                                current->comm, current->pid,
@@ -837,6 +835,7 @@ fastcall NORET_TYPE void do_exit(long code)
        group_dead = atomic_dec_and_test(&tsk->signal->live);
        if (group_dead) {
                del_timer_sync(&tsk->signal->real_timer);
+               exit_itimers(tsk->signal);
                acct_process(code);
        }
        exit_mm(tsk);
@@ -1197,7 +1196,7 @@ static int wait_task_stopped(task_t *p, int delayed_group_leader, int noreap,
 
                exit_code = p->exit_code;
                if (unlikely(!exit_code) ||
-                   unlikely(p->state > TASK_STOPPED))
+                   unlikely(p->state & TASK_TRACED))
                        goto bail_ref;
                return wait_noreap_copyout(p, pid, uid,
                                           why, (exit_code << 8) | 0x7f,