[CRIU] [PATCH] cgroup: Fix clone_flags drop error in fork_with_pid

Tycho Andersen tycho.andersen at canonical.com
Thu May 5 06:22:43 PDT 2016


On Thu, May 05, 2016 at 04:23:15PM +0800, Wang Long wrote:
> The commit dae14ddfb does not drop the CLONE_NEWCGROUP correctly.
> Thsi patch fix it.

Doh :(. Thanks,

Acked-by: Tycho Andersen <tycho.andersen at canonical.com>

> Signed-off-by: Wang Long <long.wanglong at huawei.com>
> ---
>  criu/cr-restore.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/cr-restore.c b/criu/cr-restore.c
> index 361b3ca..f115c1f 100644
> --- a/criu/cr-restore.c
> +++ b/criu/cr-restore.c
> @@ -1311,7 +1311,7 @@ static inline int fork_with_pid(struct pstree_item *item)
>  	 * move_in_cgroup(), so drop this flag here as well.
>  	 */
>  	ret = clone(restore_task_with_children, ca.stack_ptr,
> -		    (ca.clone_flags & (~CLONE_NEWNET | ~CLONE_NEWCGROUP)) | SIGCHLD, &ca);
> +		    (ca.clone_flags & ~(CLONE_NEWNET | CLONE_NEWCGROUP)) | SIGCHLD, &ca);
>  
>  	if (ret < 0) {
>  		pr_perror("Can't fork for %d", pid);
> -- 
> 1.9.1
> 


More information about the CRIU mailing list