aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-03-24 21:36:23 -0400
committerRoland McGrath <roland@redhat.com>2008-07-16 21:02:33 -0400
commitf470021adb9190819c03d6d8c5c860a17480aa6d (patch)
tree9e5c2808138624e272b562a502cfd035ae59c268 /kernel/fork.c
parent98abed02007b19bbfd68b6d06a5485afc3eeb01b (diff)
ptrace children revamp
ptrace no longer fiddles with the children/sibling links, and the old ptrace_children list is gone. Now ptrace, whether of one's own children or another's via PTRACE_ATTACH, just uses the new ptraced list instead. There should be no user-visible difference that matters. The only change is the order in which do_wait() sees multiple stopped children and stopped ptrace attachees. Since wait_task_stopped() was changed earlier so it no longer reorders the children list, we already know this won't cause any new problems. Signed-off-by: Roland McGrath <roland@redhat.com>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 4bd2f516401f..adefc1131f27 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1125,8 +1125,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1125 */ 1125 */
1126 p->group_leader = p; 1126 p->group_leader = p;
1127 INIT_LIST_HEAD(&p->thread_group); 1127 INIT_LIST_HEAD(&p->thread_group);
1128 INIT_LIST_HEAD(&p->ptrace_children); 1128 INIT_LIST_HEAD(&p->ptrace_entry);
1129 INIT_LIST_HEAD(&p->ptrace_list); 1129 INIT_LIST_HEAD(&p->ptraced);
1130 1130
1131 /* Now that the task is set up, run cgroup callbacks if 1131 /* Now that the task is set up, run cgroup callbacks if
1132 * necessary. We need to run them before the task is visible 1132 * necessary. We need to run them before the task is visible
@@ -1198,7 +1198,7 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1198 } 1198 }
1199 1199
1200 if (likely(p->pid)) { 1200 if (likely(p->pid)) {
1201 add_parent(p); 1201 list_add_tail(&p->sibling, &p->real_parent->children);
1202 if (unlikely(p->ptrace & PT_PTRACED)) 1202 if (unlikely(p->ptrace & PT_PTRACED))
1203 __ptrace_link(p, current->parent); 1203 __ptrace_link(p, current->parent);
1204 1204