[Devel] [PATCH] cr: don't try to collect or fetch ipc_ns

Serge E. Hallyn serue at us.ibm.com
Tue Apr 13 16:55:41 PDT 2010


This is just the completion of the patch i sent a few days
ago to prevent checkpoint_obj()ing the ipc_ns.  With
CONFIG_SYSVIPC=n and CONFIG_POSIX_MQUEUE=n, and without
this patch, the pthread1 testcase fails.  (The only reason
that one fails while the others succeed, i think is because
it uses 'nsexec -n', forcing a new net-ns and therefore
forcing a new nsproxy, which the other testcases do not
do).

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

diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 8f2d0b7..92c84b8 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -254,6 +254,7 @@ int ckpt_collect_ns(struct ckpt_ctx *ctx, struct task_struct *t)
 	if (ret < 0)
 		goto out;
 #endif
+#ifdef CONFIG_IPC_NS
 	ret = ckpt_obj_collect(ctx, nsproxy->ipc_ns, CKPT_OBJ_IPC_NS);
 	if (ret < 0)
 		goto out;
@@ -266,6 +267,7 @@ int ckpt_collect_ns(struct ckpt_ctx *ctx, struct task_struct *t)
 		if (ret < 0)
 			goto out;
 	}
+#endif
 
 	ret = ckpt_obj_collect(ctx, nsproxy->mnt_ns, CKPT_OBJ_MNT_NS);
 	if (ret < 0)
@@ -353,8 +355,13 @@ static void *restore_ns(struct ckpt_ctx *ctx)
 
 	if (h->ipc_objref == 0)
 		ipc_ns = ctx->root_nsproxy->ipc_ns;
+#ifdef CONFIG_IPC_NS
 	else
 		ipc_ns = ckpt_obj_fetch(ctx, h->ipc_objref, CKPT_OBJ_IPC_NS);
+#else
+	else
+		ipc_ns = ERR_PTR(-EINVAL);
+#endif
 	if (IS_ERR(ipc_ns)) {
 		ret = PTR_ERR(ipc_ns);
 		goto out;
-- 
1.7.0.4

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




More information about the Devel mailing list