diff -NurpP --minimal linux-2.6.18.1-vs2.0.2.2-rc2.1/include/linux/vs_context.h linux-2.6.18.1-vs2.0.2.2-rc2.2/include/linux/vs_context.h --- linux-2.6.18.1-vs2.0.2.2-rc2.1/include/linux/vs_context.h 2006-10-17 01:46:38 +0200 +++ linux-2.6.18.1-vs2.0.2.2-rc2.2/include/linux/vs_context.h 2006-10-20 02:33:00 +0200 @@ -210,6 +210,7 @@ static inline void __leave_vx_admin(stru } extern void exit_vx_info(struct task_struct *, int); +extern void exit_vx_info_early(struct task_struct *, int); static inline @@ -229,6 +230,9 @@ struct task_struct *vx_child_reaper(stru reaper = vxi->vx_reaper; out: + vxdprintk(VXD_CBIT(xid, 3), + "vx_child_reaper(%p[#%u,%u]) = %p[#%u,%u]\n", + p, p->xid, p->pid, reaper, reaper->xid, reaper->pid); return reaper; } diff -NurpP --minimal linux-2.6.18.1-vs2.0.2.2-rc2.1/kernel/exit.c linux-2.6.18.1-vs2.0.2.2-rc2.2/kernel/exit.c --- linux-2.6.18.1-vs2.0.2.2-rc2.1/kernel/exit.c 2006-10-18 01:19:40 +0200 +++ linux-2.6.18.1-vs2.0.2.2-rc2.2/kernel/exit.c 2006-10-20 02:23:45 +0200 @@ -940,6 +940,8 @@ fastcall NORET_TYPE void do_exit(long co tsk->exit_code = code; proc_exit_connector(tsk); + /* needs to stay before exit_notify() */ + exit_vx_info_early(tsk, code); exit_notify(tsk); #ifdef CONFIG_NUMA mpol_free(tsk->mempolicy); diff -NurpP --minimal linux-2.6.18.1-vs2.0.2.2-rc2.1/kernel/vserver/context.c linux-2.6.18.1-vs2.0.2.2-rc2.2/kernel/vserver/context.c --- linux-2.6.18.1-vs2.0.2.2-rc2.1/kernel/vserver/context.c 2006-09-20 17:01:45 +0200 +++ linux-2.6.18.1-vs2.0.2.2-rc2.2/kernel/vserver/context.c 2006-10-20 02:22:01 +0200 @@ -668,11 +668,19 @@ void exit_vx_info(struct task_struct *p, vx_nproc_dec(p); vxi->exit_code = code; + release_vx_info(vxi, p); + } +} + +void exit_vx_info_early(struct task_struct *p, int code) +{ + struct vx_info *vxi = p->vx_info; + + if (vxi) { if (vxi->vx_initpid == p->tgid) vx_exit_init(vxi, p, code); if (vxi->vx_reaper == p) vx_set_reaper(vxi, child_reaper); - release_vx_info(vxi, p); } }