* [PATCH 2/20] Move exit_task_namespaces()
@ 2007-08-10 11:47 xemul
0 siblings, 0 replies; 2+ messages in thread
From: xemul @ 2007-08-10 11:47 UTC (permalink / raw)
To: akpm; +Cc: xemul, devel, linux-kernel, containers, oleg, sukadev
Makve task release its namespaces after it has reparented all his children
to child_reaper, but before it notifies its parent about its death.
The reason to release namespaces after reparenting is that when task exits
it may send a signal to its parent (SIGCHLD), but if the parent has already
exited its namespaces there will be no way to decide what pid to dever to
him - parent can be from different namespace.
The reason to release namespace before notifying the parent it that when
task sends a SIGCHLD to parent it can call wait() on this taks and release
it. But releasing the mnt namespace implies dropping of all the mounts in
the mnt namespace and NFS expects the task to have valid sighand pointer.
Thanks to Oleg for pointing out some races that can apear and helping with
patches and fixes.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
---
exit.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- ./kernel/exit.c.ve2 2007-07-27 12:45:46.000000000 +0400
+++ ./kernel/exit.c 2007-07-27 12:46:08.000000000 +0400
@@ -796,6 +796,7 @@ static void exit_notify(struct task_stru
* jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2)
*/
forget_original_parent(tsk);
+ exit_task_namespaces(tsk);
write_lock_irq(&tasklist_lock);
/*
@@ -1003,7 +1004,6 @@ fastcall NORET_TYPE void do_exit(long co
tsk->exit_code = code;
proc_exit_connector(tsk);
- exit_task_namespaces(tsk);
exit_notify(tsk);
#ifdef CONFIG_NUMA
mpol_free(tsk->mempolicy);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/20] Move exit_task_namespaces()
@ 2007-08-07 9:29 xemul-GEFAQzZX7r8dnm+yROfE0A
0 siblings, 0 replies; 2+ messages in thread
From: xemul-GEFAQzZX7r8dnm+yROfE0A @ 2007-08-07 9:29 UTC (permalink / raw)
To: sukadev-r/Jw6+rmf7HQT0dZR+AlfA, oleg-6lXkIZvqkOAvJsYlp49lxw
Cc: containers-qjLDD68F18O7TbgM5vRIOg, xemul-GEFAQzZX7r8dnm+yROfE0A
Makve task release its namespaces after it has reparented all his children
to child_reaper, but before it notifies its parent about its death.
The reason to release namespaces after reparenting is that when task exits
it may send a signal to its parent (SIGCHLD), but if the parent has already
exited its namespaces there will be no way to decide what pid to dever to
him - parent can be from different namespace.
The reason to release namespace before notifying the parent it that when
task sends a SIGCHLD to parent it can call wait() on this taks and release
it. But releasing the mnt namespace implies dropping of all the mounts in
the mnt namespace and NFS expects the task to have valid sighand pointer.
Thanks to Oleg for pointing out some races that can apear and helping with
patches and fixes.
Signed-off-by: Pavel Emelyanov <xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Cc: Oleg Nesterov <oleg-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org>
---
exit.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
--- ./kernel/exit.c.ve2 2007-07-27 12:45:46.000000000 +0400
+++ ./kernel/exit.c 2007-07-27 12:46:08.000000000 +0400
@@ -796,6 +796,7 @@ static void exit_notify(struct task_stru
* jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2)
*/
forget_original_parent(tsk);
+ exit_task_namespaces(tsk);
write_lock_irq(&tasklist_lock);
/*
@@ -1003,7 +1004,6 @@ fastcall NORET_TYPE void do_exit(long co
tsk->exit_code = code;
proc_exit_connector(tsk);
- exit_task_namespaces(tsk);
exit_notify(tsk);
#ifdef CONFIG_NUMA
mpol_free(tsk->mempolicy);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-10 11:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-10 11:47 [PATCH 2/20] Move exit_task_namespaces() xemul
-- strict thread matches above, loose matches on Subject: below --
2007-08-07 9:29 xemul-GEFAQzZX7r8dnm+yROfE0A
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.