From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelyanov Subject: Re: [PATCH 1/15] Move exit_task_namespaces() Date: Mon, 06 Aug 2007 17:36:51 +0400 Message-ID: <46B723F3.8020905@openvz.org> References: <46A8B37B.6050108@openvz.org> <46A8B3C4.5080601@openvz.org> <20070802162023.GB137@tv-sign.ru> <46B6D52C.3010405@openvz.org> <20070806095421.GA85@tv-sign.ru> <46B6F0DA.4080904@openvz.org> <20070806103838.GA129@tv-sign.ru> <46B7060E.3020609@openvz.org> <20070806125032.GA91@tv-sign.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20070806125032.GA91-6lXkIZvqkOAvJsYlp49lxw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oleg Nesterov Cc: Linux Containers List-Id: containers.vger.kernel.org Oleg Nesterov wrote: > On 08/06, Pavel Emelyanov wrote: >> Oleg Nesterov wrote: >>> On 08/06, Pavel Emelyanov wrote: >>>> Oleg Nesterov wrote: >>>>> On 08/06, Pavel Emelyanov wrote: >>>>>> Oleg Nesterov wrote: >>>>>>> On 07/26, Pavel Emelyanov wrote: >>>>>>>> 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. >>>>>>> I almost forgot about this one... >>>>>>> >>> I guess I missed something stupid and simple... >> In other words. Let task X live in init_pid_ns, task Y is his child and >> lives >> int another namespace. task X and task Y both die. This will happen: >> >> 1. Task X call exit_task_namespaces() >> and sets its nsproxy to NULL > > Ah, got it, thanks. So the problem is not namespace itself (parent's or > child's), there are still valid (even if different but related). > > We just can't get ->parent->nsproxy. I was greatly confused by the "parent > can be from different namespace" above. We have exactly same problem if > namespaces are not differ. > > IOW, the problem is: we can't clear ->nsproxy (exit_task_namespaces) until > we get rid of ->children. This have nothing to do with different namespace. No. If the parent is always in the same namespace we do not need to get its nsproxy :) Problem is exactly in that the parent's namespace is to be known. > Oleg. > >