Oleg Nesterov 84eb646b6e handle the multi-threaded init's exit() properly
With or without this patch, multi-threaded init's are not fully supported,
but do_exit() is completely wrong.  This becomes a real problem when we
support pid namespaces.

1. do_exit() panics when the main thread of /sbin/init exits. It should not
   until the whole thread group exits. Move the code below, under the
   "if (group_dead)" check.

   Note: this means that forget_original_parent() can use an already dead
   child_reaper()'s task_struct. This is OK for /sbin/init because

   	- do_wait() from alive sub-thread still can reap a zombie, we iterate
   	  over all sub-thread's ->children lists

   	- do_notify_parent() will wakeup some alive sub-thread because it sends
   	  the group-wide signal

   However, we should remove choose_new_parent()->BUG_ON(reaper->exit_state)
   for this.

2. We are playing games with ->nsproxy->pid_ns. This code is bogus today, and
   it has to be changed anyway when we really support pid namespaces, just
   remove it.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Roland McGrath <roland@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17 08:42:51 -07:00
..
2007-07-16 09:05:47 -07:00
2007-10-01 07:52:23 -07:00
2007-10-01 07:52:23 -07:00
2006-12-07 08:39:36 -08:00
2007-10-17 08:42:48 -07:00
2007-07-16 09:05:50 -07:00
2007-10-16 09:43:10 -07:00
2006-12-04 02:00:22 -05:00
2007-10-11 22:11:12 +02:00
2007-07-16 09:05:47 -07:00
2007-10-17 08:42:50 -07:00
2007-10-11 22:11:12 +02:00
2007-10-16 09:43:04 -07:00
2007-07-16 09:05:49 -07:00
2007-07-16 09:05:49 -07:00
2007-10-15 17:00:13 +02:00
2007-07-16 09:05:50 -07:00
2007-10-01 07:52:23 -07:00
2007-10-17 08:42:48 -07:00
2007-05-09 08:57:56 +02:00
2007-08-27 10:27:48 -07:00