[CRIU] Re: [PATCH 1/5] pstree: Init pstree_item::list inside __alloc_pstree_item

Andrey Vagin avagin at parallels.com
Wed Oct 3 06:41:24 EDT 2012


Acked-by: Andrey Vagin <avagin at parallels.com>

On Wed, Oct 03, 2012 at 12:57:29PM +0400, Cyrill Gorcunov wrote:
> 
> This is a bit fishy that we do init @children list here
> but not @list itself. Better be solid and init everything
> in one place.
> 
> Also no need to poke @threads and @nr_threads, we're using
> xzalloc here anyway.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  pstree.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 

> diff --git a/pstree.c b/pstree.c
> index 6033e7e..72fcc8c 100644
> --- a/pstree.c
> +++ b/pstree.c
> @@ -38,8 +38,8 @@ struct pstree_item *__alloc_pstree_item(bool rst)
>  		return NULL;
>  
>  	INIT_LIST_HEAD(&item->children);
> -	item->threads = NULL;
> -	item->nr_threads = 0;
> +	INIT_LIST_HEAD(&item->list);
> +
>  	item->pid.virt = -1;
>  	item->pid.real = -1;
>  	item->born_sid = -1;
> @@ -157,7 +157,6 @@ int prepare_pstree(void)
>  			}
>  			root_item = pi;
>  			pi->parent = NULL;
> -			INIT_LIST_HEAD(&pi->list);
>  		} else {
>  			/*
>  			 * Fast path -- if the pstree image is not edited, the



More information about the CRIU mailing list