aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@us.ibm.com>2006-12-08 05:38:01 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:52 -0500
commit84d737866e2babdeab0c6b18ea155c6a649663b8 (patch)
treee504da826174c2804d8c680828800aa680090686 /init/main.c
parent6cc1b22a4acef3816eaa5f8c227d93d749b23195 (diff)
[PATCH] add child reaper to pid_namespace
Add a per pid_namespace child-reaper. This is needed so processes are reaped within the same pid space and do not spill over to the parent pid space. Its also needed so containers preserve existing semantic that pid == 1 would reap orphaned children. This is based on Eric Biederman's patch: http://lkml.org/lkml/2006/2/6/285 Signed-off-by: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/init/main.c b/init/main.c
index 4cdcd06e6d7..036f97c0c34 100644
--- a/init/main.c
+++ b/init/main.c
@@ -51,6 +51,7 @@
51#include <linux/debug_locks.h> 51#include <linux/debug_locks.h>
52#include <linux/lockdep.h> 52#include <linux/lockdep.h>
53#include <linux/utsrelease.h> 53#include <linux/utsrelease.h>
54#include <linux/pid_namespace.h>
54#include <linux/compile.h> 55#include <linux/compile.h>
55 56
56#include <asm/io.h> 57#include <asm/io.h>
@@ -626,8 +627,6 @@ static int __init initcall_debug_setup(char *str)
626} 627}
627__setup("initcall_debug", initcall_debug_setup); 628__setup("initcall_debug", initcall_debug_setup);
628 629
629struct task_struct *child_reaper = &init_task;
630
631extern initcall_t __initcall_start[], __initcall_end[]; 630extern initcall_t __initcall_start[], __initcall_end[];
632 631
633static void __init do_initcalls(void) 632static void __init do_initcalls(void)
@@ -727,7 +726,7 @@ static int init(void * unused)
727 * assumptions about where in the task array this 726 * assumptions about where in the task array this
728 * can be found. 727 * can be found.
729 */ 728 */
730 child_reaper = current; 729 init_pid_ns.child_reaper = current;
731 730
732 cad_pid = task_pid(current); 731 cad_pid = task_pid(current);
733 732