coredump: kill mm->core_done
[linux-2.6.git] / kernel / exit.c
index b66f0d5..8a4d4d1 100644 (file)
@@ -691,7 +691,13 @@ static void exit_mm(struct task_struct * tsk)
                if (atomic_dec_and_test(&core_state->nr_threads))
                        complete(&core_state->startup);
 
-               wait_for_completion(&mm->core_done);
+               for (;;) {
+                       set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+                       if (!self.task) /* see coredump_finish() */
+                               break;
+                       schedule();
+               }
+               __set_task_state(tsk, TASK_RUNNING);
                down_read(&mm->mmap_sem);
        }
        atomic_inc(&mm->mm_count);