Linux Container Development
 help / color / mirror / Atom feed
* [PATCH 1/1] cr: nsproxy: fix refcounting
@ 2009-05-26 22:03 Serge E. Hallyn
       [not found] ` <20090526220313.GA18572-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Serge E. Hallyn @ 2009-05-26 22:03 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

[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 <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 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;
 }
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] cr: nsproxy: fix refcounting
       [not found] ` <20090526220313.GA18572-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-05-27 18:57   ` Oren Laadan
  0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2009-05-27 18:57 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: Linux Containers

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 <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
>  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;
>  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-05-27 18:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26 22:03 [PATCH 1/1] cr: nsproxy: fix refcounting Serge E. Hallyn
     [not found] ` <20090526220313.GA18572-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-05-27 18:57   ` Oren Laadan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox