[PATCH 2/2] cr: handle CONFIG_SYSVIPC=n

Serge Hallyn serue at us.ibm.com
Fri Apr 9 14:12:58 PDT 2010


From: Serge E. Hallyn <serue at us.ibm.com>

If CONFIG_IPC_NS=n, then checkpoint a sysvipcns of 0.  If we
end up restarted on a CONFIG_SYSVIPC=y host, we'll just end up
using the parent sysvipcns, which is fine as we won't be trying
to restore any sysvipc objects.

(The existing code worked fine with CONFIG_IPC_NS=n, but not
with CONFIG_SYSVIPC=n and CONFIG_POSIX_MQUEUE=n.  But we
trigger on CONFIG_IPC_NS since even if CONFIG_SYSVIPC=y but
CONFIG_IPC_NS=n, checkpointing 0 is right).

Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
---
 kernel/nsproxy.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 5f9d809..0b43f4d 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -290,9 +290,13 @@ static int do_checkpoint_ns(struct ckpt_ctx *ctx, struct nsproxy *nsproxy)
 	if (ret <= 0)
 		goto out;
 	h->uts_objref = ret;
+#ifdef CONFIG_IPC_NS
 	ret = checkpoint_obj(ctx, nsproxy->ipc_ns, CKPT_OBJ_IPC_NS);
 	if (ret < 0)
 		goto out;
+#else	/* CONFIG_IPC_NS */
+	ret = 0;
+#endif	/* CONFIG_IPC_NS */
 	h->ipc_objref = ret;
 #ifdef CONFIG_NETNS_CHECKPOINT
 	if (!(ctx->uflags & CHECKPOINT_NONETNS))
-- 
1.7.0.4



More information about the Containers mailing list