All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] cr: fix compilation with CONFIG_UTS_NS=n
@ 2009-06-17  0:17 Serge E. Hallyn
       [not found] ` <20090617001723.GA9452-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Serge E. Hallyn @ 2009-06-17  0:17 UTC (permalink / raw)
  To: Oren Laadan; +Cc: Linux Containers

It looks like Oren wanted ns c/r to "sort of work" with CONFIG_UTS_NS=n
but kernel/utsname.c is not compiled if CONFIG_UTS_NS=n.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 include/linux/checkpoint.h |    5 +++++
 kernel/utsname.c           |   13 -------------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/include/linux/checkpoint.h b/include/linux/checkpoint.h
index c2f04c5..ef4fc33 100644
--- a/include/linux/checkpoint.h
+++ b/include/linux/checkpoint.h
@@ -136,8 +136,13 @@ extern int checkpoint_ns(struct ckpt_ctx *ctx, void *ptr);
 extern void *restore_ns(struct ckpt_ctx *ctx);
 
 /* uts-ns */
+#ifdef CONFIG_UTS_NS
 extern int checkpoint_uts_ns(struct ckpt_ctx *ctx, void *ptr);
 extern void *restore_uts_ns(struct ckpt_ctx *ctx);
+#else
+#define checkpoint_uts_ns checkpoint_bad
+#define restore_uts_ns restore_bad
+#endif
 
 /* ipc-ns */
 #ifdef CONFIG_SYSVIPC
diff --git a/kernel/utsname.c b/kernel/utsname.c
index 76f9966..5c12ebb 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -130,11 +130,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
 	    h->domainname_len > sizeof(uts_ns->name.domainname))
 		goto out;
 
-	/*
-	 * If !CONFIG_UTS_NS, do not restore the global uts state, as
-	 * it is used by other processes.
-	 */
-#ifdef CONFIG_UTS_NS
 	ret = -ENOMEM;
 	uts_ns = create_uts_ns();
 	if (!uts_ns)
@@ -153,14 +148,6 @@ static struct uts_namespace *do_restore_uts_ns(struct ckpt_ctx *ctx)
 	up_read(&uts_sem);
 	if (ret < 0)
 		goto out;
-#else
-	ret = -EEXIST;
-	/* complain if image contains multiple namespaces */
-	if (ctx->stats.uts_ns)
-		goto out;
-	uts_ns = current->nsproxy->uts_ns;
-	get_uts_ns(uts_ns);
-#endif
 
 	ctx->stats.uts_ns++;
  out:
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-19 17:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17  0:17 [PATCH 1/1] cr: fix compilation with CONFIG_UTS_NS=n Serge E. Hallyn
     [not found] ` <20090617001723.GA9452-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-18 16:46   ` Oren Laadan
     [not found]     ` <4A3A6F61.5030401-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2009-06-18 17:09       ` Serge E. Hallyn
2009-06-18 18:25       ` Nathan Lynch
     [not found]         ` <m3ws79h01p.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-18 22:32           ` Serge E. Hallyn
     [not found]             ` <20090618223213.GA13179-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-18 23:12               ` Nathan Lynch
     [not found]                 ` <m3zlc5kugu.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-19  4:14                   ` Oren Laadan
2009-06-19 14:56                   ` Serge E. Hallyn
     [not found]                     ` <20090619145606.GB22381-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-19 17:10                       ` Nathan Lynch
     [not found]                         ` <m3ljnogneb.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2009-06-19 17:53                           ` Serge E. Hallyn
2009-06-19  4:06           ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.