Commit 1ce382ad authored by Wang Long's avatar Wang Long Committed by Pavel Emelyanov

cgroup: Fix clone_flags drop error in fork_with_pid

The commit dae14ddf does not drop the CLONE_NEWCGROUP correctly.
Thsi patch fix it.
Signed-off-by: 's avatarWang Long <long.wanglong@huawei.com>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 035626ca
...@@ -1291,7 +1291,7 @@ static inline int fork_with_pid(struct pstree_item *item) ...@@ -1291,7 +1291,7 @@ static inline int fork_with_pid(struct pstree_item *item)
* move_in_cgroup(), so drop this flag here as well. * move_in_cgroup(), so drop this flag here as well.
*/ */
ret = clone(restore_task_with_children, ca.stack_ptr, 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) { if (ret < 0) {
pr_perror("Can't fork for %d", pid); pr_perror("Can't fork for %d", pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment