From 628e717b14d30c7a3a0994bf4c7620272561534a Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 20 Jun 2012 12:53:04 -0700 Subject: [PATCH] --- yaml --- r: 311123 b: refs/heads/master c: 50d75f8daead8a1f850c40a3b6c6575ab19b48cf h: refs/heads/master i: 311121: b17e3affcd3933bd004813454a5b61bba6ca4a2c 311119: bfd4ecbc6d2af5033d42cabc811c4b2a3ff02ef4 v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index df193983bf6e..9385c9f12fa6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6347e90091041e34bea625370794c92f4ce71228 +refs/heads/master: 50d75f8daead8a1f850c40a3b6c6575ab19b48cf diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index a85efd2348bd..2f59cc334516 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -64,6 +64,7 @@ static void exit_mm(struct task_struct * tsk); static void __unhash_process(struct task_struct *p, bool group_dead) { nr_threads--; + detach_pid(p, PIDTYPE_PID); if (group_dead) { detach_pid(p, PIDTYPE_PGID); detach_pid(p, PIDTYPE_SID); @@ -78,13 +79,12 @@ static void __unhash_process(struct task_struct *p, bool group_dead) if (IS_ENABLED(CONFIG_PID_NS)) { struct task_struct *parent = p->real_parent; - if ((task_active_pid_ns(p)->child_reaper == parent) && + if ((task_active_pid_ns(parent)->child_reaper == parent) && list_empty(&parent->children) && (parent->flags & PF_EXITING)) wake_up_process(parent); } } - detach_pid(p, PIDTYPE_PID); list_del_rcu(&p->thread_group); } @@ -732,12 +732,6 @@ static struct task_struct *find_new_reaper(struct task_struct *father) zap_pid_ns_processes(pid_ns); write_lock_irq(&tasklist_lock); - /* - * We can not clear ->child_reaper or leave it alone. - * There may by stealth EXIT_DEAD tasks on ->children, - * forget_original_parent() must move them somewhere. - */ - pid_ns->child_reaper = init_pid_ns.child_reaper; } else if (father->signal->has_child_subreaper) { struct task_struct *reaper;