mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] don't use REMOVE_LINKS/SET_LINKS for reparenting
@ 2006-02-03 19:33 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2006-02-03 19:33 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Roland McGrath, Eric W. Biederman, Andrew Morton

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 <oleg@tv-sign.ru>

--- RC-1/kernel/exit.c~2_LINKS	2006-02-04 00:28:49.000000000 +0300
+++ RC-1/kernel/exit.c	2006-02-04 00:53:54.000000000 +0300
@@ -220,10 +220,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;
--- RC-1/kernel/ptrace.c~2_LINKS	2006-02-04 00:23:41.000000000 +0300
+++ RC-1/kernel/ptrace.c	2006-02-04 00:53:54.000000000 +0300
@@ -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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-03 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-03 19:33 [PATCH 2/2] don't use REMOVE_LINKS/SET_LINKS for reparenting Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®