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

Wang Long long.wanglong at huawei.com
Thu May 5 01:23:15 PDT 2016


The commit dae14ddfb does not drop the CLONE_NEWCGROUP correctly.
Thsi patch fix it.

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