Skip to contentSkip to conversation

cr: don't try to collect or fetch ipc_ns

PATCH New Serge E. Hallyn 1 participant 1 message Apr 13, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cr: don't try to collect or fetch ipc_ns

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

---
 kernel/nsproxy.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
kernel/nsproxy.c +7 -0
index 8f2d0b7..92c84b8 100644
@@ -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;
Signature · 1 line
1.7.0.4