All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] don't call pre_restore_task twice
@ 2009-10-07 23:47 Serge E. Hallyn
       [not found] ` <20091007234750.GA6881-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Serge E. Hallyn @ 2009-10-07 23:47 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

Pre_restore_task is being called both before and inside
restore_task, causing a memory leak at
current->checkpoint_data.

Only call it once, outside restore_task.

This fixes a memory leak spotted by Dan Smith, and the
actual bug was deduced by Matt Helsley.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Reported-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 checkpoint/process.c |    4 ----
 checkpoint/restart.c |    1 +
 2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/checkpoint/process.c b/checkpoint/process.c
index 424f688..c51e036 100644
--- a/checkpoint/process.c
+++ b/checkpoint/process.c
@@ -864,10 +864,6 @@ int restore_task(struct ckpt_ctx *ctx)
 {
 	int ret;
 
-	ret = pre_restore_task(ctx);
-	if (ret < 0)
-		goto out;
-
 	ret = restore_task_struct(ctx);
 	ckpt_debug("task %d\n", ret);
 	if (ret < 0)
diff --git a/checkpoint/restart.c b/checkpoint/restart.c
index 3a58a76..fc94374 100644
--- a/checkpoint/restart.c
+++ b/checkpoint/restart.c
@@ -967,6 +967,7 @@ static int do_restore_task(void)
 	 */
 	if (zombie) {
 		restore_debug_exit(ctx);
+		post_restore_task(ctx);
 		ckpt_ctx_put(ctx);
 		do_exit(current->exit_code);
 	}
-- 
1.5.4.3

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

end of thread, other threads:[~2009-10-14 22:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 23:47 [PATCH 1/1] don't call pre_restore_task twice Serge E. Hallyn
     [not found] ` <20091007234750.GA6881-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-08  3:09   ` Matt Helsley
     [not found]     ` <20091008030919.GH18101-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2009-10-08 14:12       ` Serge E. Hallyn
     [not found]         ` <20091008141258.GA21486-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-10-08 18:49           ` Matt Helsley
2009-10-08 18:03   ` Dan Smith
     [not found]     ` <871vldg3uz.fsf-FLMGYpZoEPULwtHQx/6qkW3U47Q5hpJU@public.gmane.org>
2009-10-08 18:19       ` Serge E. Hallyn
2009-10-14 22:24   ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.