[PATCH] c/r: fix "scheduling in atomic" while restoring ipc shm

Oren Laadan orenl at cs.columbia.edu
Tue Mar 2 13:59:20 PST 2010



Serge E. Hallyn wrote:
> Quoting Nikita V. Youshchenko (yoush at cs.msu.su):
>>> Hi Nikita,
>>>
>>> Thanks for the report and the analysis. It actually helped to
>>> pinpoint a couple of other minor issues in the code. This patch
>>> should fix all of these.
>>>
>>> Oren.
>> Hi Oren.
>>
>> With ckpt-v19 plus this patch applied, we still are getting a kernel
>> crash, with BUG() fired at
>> +       ipc = idr_find(&msg_ids->ipcs_idr, h->perms.id);
>> +       BUG_ON(!ipc);
>> added by the patch.
>>
>> By looking at the code, I can't understand how this idr_find() can at
>> all succeed, if the namespace it is looking in was just created and
>> is empty.
>>
>> What code adds object in question into this idr?
> 
> The do_semget() in ipc/checkpoint_sem.c:restore_ipc_sem() does that.
> At the very least Oren's comment was wrong in that perms->seq will
> not get restored unless we continue to do it explicitly.  With the
> following trivial patch I sometimes get success, but usually not.
> Still trying to find what's up...

Actually, perms->seq (ipc->seq) is set correctly when the object
is allocated in ipc_addid(). It was redundant to explicitly restore
it in restore_load_ipc_perms().

Oren.

> 
> From 809cc2f1eccc39d45a145e280b6d992e4fa1e683 Mon Sep 17 00:00:00 2001
> From: Serge E. Hallyn <serue at us.ibm.com>
> Date: Tue, 2 Mar 2010 05:43:21 -0600
> Subject: [PATCH 1/1] restore perm->seq
> 
> Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
> ---
>  ipc/checkpoint.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/ipc/checkpoint.c b/ipc/checkpoint.c
> index 06027c2..f865471 100644
> --- a/ipc/checkpoint.c
> +++ b/ipc/checkpoint.c
> @@ -210,6 +210,7 @@ int restore_load_ipc_perms(struct ckpt_ctx *ctx,
>  	perm->cuid = h->cuid;
>  	perm->cgid = h->cgid;
>  	perm->mode = h->mode;
> +	perm->seq = h->seq;
>  
>  	return security_restore_obj(ctx, (void *)perm,
>  				    CKPT_SECURITY_IPC,


More information about the Containers mailing list