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

Serge E. Hallyn serue at us.ibm.com
Tue Mar 2 09:48:55 PST 2010


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...

>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,
-- 
1.6.0.6


-serge
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list