From: Oren Laadan Subject: Re: [PATCH 1/1] cr: nsproxy: fix refcounting Date: Wed, 27 May 2009 14:57:46 -0400 Message-ID: <4A1D8D2A.8000709@cs.columbia.edu> References: <20090526220313.GA18572@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090526220313.GA18572-r/Jw6+rmf7HQT0dZR+AlfA@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: "Serge E. Hallyn" Cc: Linux Containers List-Id: containers.vger.kernel.org thanks, applied. Serge E. Hallyn wrote: > [This is the fix for the bug I was trying to nail down earlier today] > > If more than one restarted task are to share a checkpointed nsproxy, > then we must inc the count on the nsproxy for each new task, as > switch_task_namespaces() does not do that for us. > > Signed-off-by: Serge E. Hallyn > --- > checkpoint/process.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/checkpoint/process.c b/checkpoint/process.c > index fa166cd..52d2a9c 100644 > --- a/checkpoint/process.c > +++ b/checkpoint/process.c > @@ -603,8 +603,10 @@ static int restore_ns_obj(struct ckpt_ctx *ctx, int ns_objref) > if (IS_ERR(nsproxy)) > return PTR_ERR(nsproxy); > > - if (nsproxy != task_nsproxy(current)) > + if (nsproxy != task_nsproxy(current)) { > + get_nsproxy(nsproxy); > switch_task_namespaces(current, nsproxy); > + } > > return 0; > }