From: Oleg Nesterov There are places where kernel uses REMOVE_LINKS/SET_LINKS while changing process's ->parent. Use add_parent/remove_parent instead, they don't abuse of global process list. Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton --- kernel/exit.c | 4 ++-- kernel/ptrace.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff -puN kernel/exit.c~dont-use-remove_links-set_links-for-reparenting kernel/exit.c --- devel/kernel/exit.c~dont-use-remove_links-set_links-for-reparenting 2006-02-07 13:19:43.000000000 -0800 +++ devel-akpm/kernel/exit.c 2006-02-07 13:19:43.000000000 -0800 @@ -236,10 +236,10 @@ static void reparent_to_init(void) ptrace_unlink(current); /* Reparent to init */ - REMOVE_LINKS(current); + remove_parent(current); current->parent = child_reaper; current->real_parent = child_reaper; - SET_LINKS(current); + add_parent(current); /* Set the exit signal to SIGCHLD so we signal init on exit */ current->exit_signal = SIGCHLD; diff -puN kernel/ptrace.c~dont-use-remove_links-set_links-for-reparenting kernel/ptrace.c --- devel/kernel/ptrace.c~dont-use-remove_links-set_links-for-reparenting 2006-02-07 13:19:43.000000000 -0800 +++ devel-akpm/kernel/ptrace.c 2006-02-07 13:19:43.000000000 -0800 @@ -35,9 +35,9 @@ void __ptrace_link(task_t *child, task_t if (child->parent == new_parent) return; list_add(&child->ptrace_list, &child->parent->ptrace_children); - REMOVE_LINKS(child); + remove_parent(child); child->parent = new_parent; - SET_LINKS(child); + add_parent(child); } /* @@ -77,9 +77,9 @@ void __ptrace_unlink(task_t *child) child->ptrace = 0; if (!list_empty(&child->ptrace_list)) { list_del_init(&child->ptrace_list); - REMOVE_LINKS(child); + remove_parent(child); child->parent = child->real_parent; - SET_LINKS(child); + add_parent(child); } ptrace_untrace(child); _