>From 4cd7f4f0d7b2b28bc26409e8d8ac4ad427d537d4 Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Wed, 21 Mar 2012 15:45:08 +0100 Subject: [PATCH] Actually use VServer context reaper --- kernel/exit.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/kernel/exit.c b/kernel/exit.c index 45f0658..0049846 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -859,6 +859,8 @@ static struct task_struct *find_new_reaper(struct task_struct *father) { struct pid_namespace *pid_ns = task_active_pid_ns(father); struct task_struct *thread; + struct vx_info *vxi = father->vx_info; + struct task_struct *reaper; thread = father; while_each_thread(father, thread) { @@ -869,6 +871,15 @@ static struct task_struct *find_new_reaper(struct task_struct *father) return thread; } + reaper = pid_ns->child_reaper; + if (vxi) { + BUG_ON(!vxi->vx_reaper); + if (vxi->vx_reaper != init_pid_ns.child_reaper && + vxi->vx_reaper != father) { + reaper = vxi->vx_reaper; + } + } + if (unlikely(pid_ns->child_reaper == father)) { write_unlock_irq(&tasklist_lock); if (unlikely(pid_ns == &init_pid_ns)) @@ -884,7 +895,7 @@ static struct task_struct *find_new_reaper(struct task_struct *father) pid_ns->child_reaper = init_pid_ns.child_reaper; } - return pid_ns->child_reaper; + return reaper; } static void forget_original_parent(struct task_struct *father) -- 1.7.2.3