[CRIU] [PATCH] cgroup: Don't collect criu's stray cgset

Tycho Andersen tycho.andersen at canonical.com
Thu Feb 25 07:44:42 PST 2016


On Thu, Feb 25, 2016 at 04:02:53PM +0300, Pavel Emelyanov wrote:
> In commit 736a2940 there was added a collection of non-root task's
> cgsets. But criu's cgset should anyway be excluded from it.
> 
> Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
> 
> P.S.
> 
> Tycho, would you be able to cook a test for dumping cgroups that don't
> match the root? :)

Yes, the cgroupns test requires this, but I can make one that
explicitly does so soon.

Thanks,

Tycho

> ---
>  criu/cgroup.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/criu/cgroup.c b/criu/cgroup.c
> index fbe91d3..272df29 100644
> --- a/criu/cgroup.c
> +++ b/criu/cgroup.c
> @@ -689,10 +689,13 @@ int dump_task_cgroup(struct pstree_item *item, u32 *cg_id, struct parasite_dump_
>  		BUG_ON(criu_cgset);
>  		criu_cgset = cs;
>  		pr_info("Set %d is criu one\n", cs->id);
> -	} else if (item == root_item) {
> -		BUG_ON(root_cgset);
> -		root_cgset = cs;
> -		pr_info("Set %d is root one\n", cs->id);
> +	} else {
> +		if (item == root_item) {
> +			BUG_ON(root_cgset);
> +			root_cgset = cs;
> +			pr_info("Set %d is root one\n", cs->id);
> +		} else
> +			pr_info("Set %d is a stray\n", cs->id);
>  
>  		/*
>  		 * The on-stack ctls is moved into cs inside
> @@ -700,10 +703,6 @@ int dump_task_cgroup(struct pstree_item *item, u32 *cg_id, struct parasite_dump_
>  		 */
>  		if (cs != criu_cgset && collect_cgroups(&cs->ctls))
>  			return -1;
> -	} else {
> -		pr_info("Set %d is a stray\n", cs->id);
> -		if (collect_cgroups(&cs->ctls))
> -			return -1;
>  	}
>  
>  	*cg_id = cs->id;
> -- 
> 2.5.0


More information about the CRIU mailing list