提交 d1e98f42 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

ptrace: wait_task_zombie: s/->parent/->real_parent/

Change wait_task_zombie() to use ->real_parent instead of ->parent.  We
could even use current afaics, but ->real_parent is more clean.

We know that the child is not ptrace_reparented() and thus they are equal.
 But we should avoid using task_struct->parent, we are going to remove it.
Signed-off-by: NOleg Nesterov <oleg@redhat.com>
Acked-by: NRoland McGrath <roland@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 8053bdd5
...@@ -1204,7 +1204,7 @@ static int wait_task_zombie(struct task_struct *p, int options, ...@@ -1204,7 +1204,7 @@ static int wait_task_zombie(struct task_struct *p, int options,
* p->signal fields, because they are only touched by * p->signal fields, because they are only touched by
* __exit_signal, which runs with tasklist_lock * __exit_signal, which runs with tasklist_lock
* write-locked anyway, and so is excluded here. We do * write-locked anyway, and so is excluded here. We do
* need to protect the access to p->parent->signal fields, * need to protect the access to parent->signal fields,
* as other threads in the parent group can be right * as other threads in the parent group can be right
* here reaping other children at the same time. * here reaping other children at the same time.
* *
...@@ -1213,8 +1213,8 @@ static int wait_task_zombie(struct task_struct *p, int options, ...@@ -1213,8 +1213,8 @@ static int wait_task_zombie(struct task_struct *p, int options,
* group including the group leader. * group including the group leader.
*/ */
thread_group_cputime(p, &cputime); thread_group_cputime(p, &cputime);
spin_lock_irq(&p->parent->sighand->siglock); spin_lock_irq(&p->real_parent->sighand->siglock);
psig = p->parent->signal; psig = p->real_parent->signal;
sig = p->signal; sig = p->signal;
psig->cutime = psig->cutime =
cputime_add(psig->cutime, cputime_add(psig->cutime,
...@@ -1245,7 +1245,7 @@ static int wait_task_zombie(struct task_struct *p, int options, ...@@ -1245,7 +1245,7 @@ static int wait_task_zombie(struct task_struct *p, int options,
sig->oublock + sig->coublock; sig->oublock + sig->coublock;
task_io_accounting_add(&psig->ioac, &p->ioac); task_io_accounting_add(&psig->ioac, &p->ioac);
task_io_accounting_add(&psig->ioac, &sig->ioac); task_io_accounting_add(&psig->ioac, &sig->ioac);
spin_unlock_irq(&p->parent->sighand->siglock); spin_unlock_irq(&p->real_parent->sighand->siglock);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册