[CRIU] [PATCH] restore: Set CLONE_PARENT iif pdeath_sig is present, v4

Pavel Emelyanov xemul at parallels.com
Thu Aug 14 11:01:34 PDT 2014


On 08/14/2014 09:54 PM, Cyrill Gorcunov wrote:
> On Thu, Aug 14, 2014 at 09:48:25PM +0400, Andrew Vagin wrote:
>>>  static inline int fork_with_pid(struct pstree_item *item)
>>>  {
>>>  	int ret = -1, fd;
>>> @@ -951,6 +982,9 @@ static inline int fork_with_pid(struct pstree_item *item)
>>>  			pr_err("Unknown task state %d\n", item->state);
>>>  			return -1;
>>>  		}
>>> +
>>> +		if (unlikely(item->pid.virt != INIT_PID))
>>
>> == ?
> 
> thanks, forgot to merge update. attached
> 
> @@ -951,6 +982,9 @@ static inline int fork_with_pid(struct pstree_item *item)
>  			pr_err("Unknown task state %d\n", item->state);
>  			return -1;
>  		}
> +
> +		if (unlikely(item->pid.virt == INIT_PID))

What if we restore non-containerized tree with root task having pid != 1?

> +			maybe_clone_parent(item, &ca);
>  	} else {
>  		/*
>  		 * Helper entry will not get moved around and thus




More information about the CRIU mailing list