From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Containers <containers@lists.osdl.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/1] ipc namespace: initialize init_ipc_ns.count to 1
Date: Wed, 4 Mar 2009 09:52:51 -0600 [thread overview]
Message-ID: <20090304155251.GA11741@us.ibm.com> (raw)
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
reply other threads:[~2009-03-04 15:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090304155251.GA11741@us.ibm.com \
--to=serue@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=containers@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox