All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ipc namespace: initialize init_ipc_ns.count to 1
@ 2009-03-03  1:45 Serge E. Hallyn
  0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2009-03-03  1:45 UTC (permalink / raw)
  To: Linux Containers

Any objections to this patch?

From cfecafff4d4b1bb0f8fd49eb8e19384b34a7dc22 Mon Sep 17 00:00:00 2001
From: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Date: Mon, 2 Mar 2009 16:40:18 -0800
Subject: [PATCH 1/1] ipc namespace: initialize init_ipc_ns.count to 1

That's one count for the init task.  Nothing else pins an
ipc ns (i.e. not ipcns->mq_mnt).  The only references to
init_ipc_ns are the sysctl .data calculations, which should
remain safe.

Signed-off-by: Serge E. Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
 ipc/msgutil.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index e5d6da1..f095ee2 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -26,8 +26,7 @@ DEFINE_SPINLOCK(mq_lock);
  * and not CONFIG_IPC_NS.
  */
 struct ipc_namespace init_ipc_ns = {
-	/* It's not for this patch to change, but should this be 1? */
-	.count		= ATOMIC_INIT(2),
+	.count		= ATOMIC_INIT(1),
 #ifdef CONFIG_POSIX_MQUEUE
 	.mq_queues_max   = DFLT_QUEUESMAX,
 	.mq_msg_max      = DFLT_MSGMAX,
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [PATCH 1/1] ipc namespace: initialize init_ipc_ns.count to 1
@ 2009-03-04 15:52 Serge E. Hallyn
  0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2009-03-04 15:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Containers, lkml

Hi Andrew,

when I sent an earlier version of the posix mqueue namespaces patchset
you called me on setting init_ipc_ns.count to 2.  The following patch
changes that to 1.  This is safe because the 1-count is for swapper, who
cannot unshare the namespace.  Having init do unshare(CLONE_NEWIPC) only
drops the count to 1.  No pre-init resources other than tasks pin (and
therefore can decrease the refcount on) an ipc_ns.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 ipc/msgutil.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index e5d6da1..f095ee2 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -26,8 +26,7 @@ DEFINE_SPINLOCK(mq_lock);
  * and not CONFIG_IPC_NS.
  */
 struct ipc_namespace init_ipc_ns = {
-	/* It's not for this patch to change, but should this be 1? */
-	.count		= ATOMIC_INIT(2),
+	.count		= ATOMIC_INIT(1),
 #ifdef CONFIG_POSIX_MQUEUE
 	.mq_queues_max   = DFLT_QUEUESMAX,
 	.mq_msg_max      = DFLT_MSGMAX,
-- 
1.5.4.3

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

end of thread, other threads:[~2009-03-04 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03  1:45 [PATCH 1/1] ipc namespace: initialize init_ipc_ns.count to 1 Serge E. Hallyn
  -- strict thread matches above, loose matches on Subject: below --
2009-03-04 15:52 Serge E. Hallyn

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.