From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sukadev Bhattiprolu Subject: Re: [RFC][PATCH 7/7][v2] Define clone_with_pids syscall Date: Fri, 29 May 2009 14:19:22 -0700 Message-ID: <20090529211922.GC12597@us.ibm.com> References: <4A1EA73F.1080802@cs.columbia.edu> <20090528173019.GB26183@us.ibm.com> <4A1F228C.2020201@cs.columbia.edu> <20090529030558.GA2548@us.ibm.com> <4A1F72A1.4070103@cs.columbia.edu> <20090529054645.GA3344@us.ibm.com> <4A1F78AF.6030404@cs.columbia.edu> <20090529170616.GA12597@us.ibm.com> <20090529193416.GB12597@us.ibm.com> <4A203F2E.1060807@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4A203F2E.1060807-eQaUEPhvms7ENvBUuze7eA@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: Oren Laadan Cc: Containers , "David C. Hansen" List-Id: containers.vger.kernel.org Oren Laadan [orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org] wrote: | | | Sukadev Bhattiprolu wrote: | > Sukadev Bhattiprolu [sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org] wrote: | > | Oren Laadan [orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org] wrote: | > | > I am not sure what the semantics should be for this case: | > | > - checkpoint a process that is in level-3 pid namespace | > - restart in a level-2 or level-1 pid namespace | > | | Meaning: a container root was at level-3, so tasks in the container | were level-3 through level-(3+N), where N is the in-container depth | so to speak. Then it was restarted such that the base became level-2 | or level-1. | | I think we already covered this. | Sorry, I meant level3 not 'level minus 3' :-) Restating, suppose init_pid_ns is L0, and L3 is a pid namespace 3 levels deep (i.e the process has 4 pids at checkpoint time). When restarting, if the process only needs 2 pids bc it is L1, current behavior is to return -EINVAL. I have this check in copy_target_pids(): + if (num_pids < 0 || num_pids > nesting) + return ERR_PTR(-EINVAL); Is it ok to return -EINVAL when num_pids > nesting ?