[PATCH 1/1] don't call pre_restore_task twice

Oren Laadan orenl at librato.com
Wed Oct 14 15:24:53 PDT 2009


Pulled.

Serge E. Hallyn wrote:
> 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 at us.ibm.com>
> Reported-by: Dan Smith <danms at us.ibm.com>
> Cc: Dan Smith <danms at us.ibm.com>
> Cc: Matt Helsley <matthltc at us.ibm.com>
> 
> Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
> ---
>  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);
>  	}


More information about the Containers mailing list