cgroup: Fix clone_flags drop error in fork_with_pid

Submitted by Wang Long on May 5, 2016, 8:23 a.m.

Details

Message ID 1462436595-25566-1-git-send-email-long.wanglong@huawei.com
State Accepted
Series "cgroup: Fix clone_flags drop error in fork_with_pid"
Commit ff822bc5c8fa6544cdf3888d466d9a470248c7b8
Headers show

Commit Message

Wang Long May 5, 2016, 8:23 a.m.
The commit dae14ddfb does not drop the CLONE_NEWCGROUP correctly.
Thsi patch fix it.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
---
 criu/cr-restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);

Comments

Tycho Andersen May 5, 2016, 1:22 p.m.
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@canonical.com>

> Signed-off-by: Wang Long <long.wanglong@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
>
Pavel Emelianov May 6, 2016, 12:08 p.m.
Applied, thanks