summaryrefslogtreecommitdiff
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 774e6b5061b8..2b355e926c13 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -342,23 +342,18 @@ kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent)
static void coredump_task_exit(struct task_struct *tsk)
{
struct core_state *core_state;
- struct mm_struct *mm;
-
- mm = tsk->mm;
- if (!mm)
- return;
/*
* Serialize with any possible pending coredump.
- * We must hold mmap_lock around checking core_state
+ * We must hold siglock around checking core_state
* and setting PF_POSTCOREDUMP. The core-inducing thread
* will increment ->nr_threads for each thread in the
* group without PF_POSTCOREDUMP set.
*/
- mmap_read_lock(mm);
+ spin_lock_irq(&tsk->sighand->siglock);
tsk->flags |= PF_POSTCOREDUMP;
- core_state = mm->core_state;
- mmap_read_unlock(mm);
+ core_state = tsk->signal->core_state;
+ spin_unlock_irq(&tsk->sighand->siglock);
if (core_state) {
struct core_thread self;