Commit 57b59c4a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

coredump_wait: don't call complete_vfork_done()

Now that CLONE_VFORK is killable, coredump_wait() no longer needs
complete_vfork_done().  zap_threads() should find and kill all tasks with
the same ->mm, this includes our parent if ->vfork_done is set.

mm_release() becomes the only caller, unexport complete_vfork_done().
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d68b46fe
...@@ -1926,19 +1926,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state) ...@@ -1926,19 +1926,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
core_waiters = zap_threads(tsk, mm, core_state, exit_code); core_waiters = zap_threads(tsk, mm, core_state, exit_code);
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
if (unlikely(core_waiters < 0)) if (core_waiters > 0)
goto fail;
/*
* Make sure nobody is waiting for us to release the VM,
* otherwise we can deadlock when we wait on each other
*/
if (tsk->vfork_done)
complete_vfork_done(tsk);
if (core_waiters)
wait_for_completion(&core_state->startup); wait_for_completion(&core_state->startup);
fail:
return core_waiters; return core_waiters;
} }
......
...@@ -2291,7 +2291,6 @@ extern int do_execve(const char *, ...@@ -2291,7 +2291,6 @@ extern int do_execve(const char *,
const char __user * const __user *, const char __user * const __user *,
const char __user * const __user *, struct pt_regs *); const char __user * const __user *, struct pt_regs *);
extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
extern void complete_vfork_done(struct task_struct *tsk);
struct task_struct *fork_idle(int); struct task_struct *fork_idle(int);
extern void set_task_comm(struct task_struct *tsk, char *from); extern void set_task_comm(struct task_struct *tsk, char *from);
......
...@@ -668,7 +668,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) ...@@ -668,7 +668,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode)
return mm; return mm;
} }
void complete_vfork_done(struct task_struct *tsk) static void complete_vfork_done(struct task_struct *tsk)
{ {
struct completion *vfork; struct completion *vfork;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment