[CRIU] Re: [PATCH cr 06/10] restore: restore sid of task which isn't leaders and isn't a child of init (v3)

Pavel Emelyanov xemul at parallels.com
Thu Jun 21 05:00:08 EDT 2012


On 06/21/2012 11:35 AM, Andrey Vagin wrote:
> 
> It's sign, that a parent has been changed sid after forking a child.
> We should know a sid with which a process was born, because in a processes
> chain, more then one process might change SID.
> 
> v2: fix names of variables
> v3: prevent rewriting of born_sid
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  cr-dump.c         |    1 +
>  cr-restore.c      |   55 ++++++++++++++++++++++++++++++++++++++++++++++++----
>  include/crtools.h |    1 +
>  3 files changed, 52 insertions(+), 5 deletions(-)
> 

> +			while (parent && parent->pid.virt != item->sid) {
> +				BUG_ON(parent->born_sid != -1 && parent->born_sid != item->sid);

This should abort the restoer with error message, not BUG().

> +				parent->born_sid = item->sid;
> +				pr_info("%d was born with sid %d\n", parent->pid.virt, item->sid);
> +				parent = parent->parent;
> +			}
> +
> +			if (parent == NULL) {
> +				pr_err("Can't find a session leader for %d\n", item->sid);
> +			}

Only pr_err? No exit?


More information about the CRIU mailing list