From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Dave Hansen <dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Cc: Linux Containers
<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 2/2] ipc namespaces: implement support for posix msqueues
Date: Wed, 17 Dec 2008 13:08:26 -0600 [thread overview]
Message-ID: <20081217190826.GA25890@us.ibm.com> (raw)
In-Reply-To: <1229540099.17206.426.camel@nimitz>
Quoting Dave Hansen (dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org):
> On Wed, 2008-12-17 at 11:55 -0600, Serge E. Hallyn wrote:
> > -void free_ipc_ns(struct kref *kref)
> > +void put_ipc_ns(struct ipc_namespace *ns)
> > {
> > - struct ipc_namespace *ns;
> > + if (ns && atomic_dec_and_lock(&ns->count, &mq_lock)) {
> > + mq_clear_sbinfo(ns);
> > + spin_unlock(&mq_lock);
> > + mq_put_mnt(ns);
> > + free_ipc_ns(ns);
> > + }
> > +}
>
> OK, I see now why you wanted to remove the kref and add an atomic_t.
> That's probably worth a sentence in the patch description.
Good point, will do.
> I know that atomic_dec_and_lock() can be a nice logical thing to do, but
> is it necessary here? Basically, is there something that happens under
> mq_lock that can re-raise the ns->count?
A racing task from another ipc namespace can open a mq file through
the VFS and thereby bump the ipc's refcount. Will comment that here and
in the patch description.
thanks,
-serge
WARNING: multiple messages have this Message-ID (diff)
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Linux Containers <containers@lists.osdl.org>
Subject: Re: [PATCH 2/2] ipc namespaces: implement support for posix msqueues
Date: Wed, 17 Dec 2008 13:08:26 -0600 [thread overview]
Message-ID: <20081217190826.GA25890@us.ibm.com> (raw)
In-Reply-To: <1229540099.17206.426.camel@nimitz>
Quoting Dave Hansen (dave@linux.vnet.ibm.com):
> On Wed, 2008-12-17 at 11:55 -0600, Serge E. Hallyn wrote:
> > -void free_ipc_ns(struct kref *kref)
> > +void put_ipc_ns(struct ipc_namespace *ns)
> > {
> > - struct ipc_namespace *ns;
> > + if (ns && atomic_dec_and_lock(&ns->count, &mq_lock)) {
> > + mq_clear_sbinfo(ns);
> > + spin_unlock(&mq_lock);
> > + mq_put_mnt(ns);
> > + free_ipc_ns(ns);
> > + }
> > +}
>
> OK, I see now why you wanted to remove the kref and add an atomic_t.
> That's probably worth a sentence in the patch description.
Good point, will do.
> I know that atomic_dec_and_lock() can be a nice logical thing to do, but
> is it necessary here? Basically, is there something that happens under
> mq_lock that can re-raise the ns->count?
A racing task from another ipc namespace can open a mq file through
the VFS and thereby bump the ipc's refcount. Will comment that here and
in the patch description.
thanks,
-serge
next prev parent reply other threads:[~2008-12-17 19:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-17 17:55 [RFC patch 0/2] posix mqueue namespace (v12) Serge E. Hallyn
2008-12-17 17:55 ` [PATCH 1/2] mqueue ns: move mqueue_mnt into struct ipc_namespace Serge E. Hallyn
2008-12-17 18:36 ` Dave Hansen
2008-12-17 18:52 ` Serge E. Hallyn
2008-12-17 18:55 ` Dave Hansen
2008-12-17 17:55 ` [PATCH 2/2] ipc namespaces: implement support for posix msqueues Serge E. Hallyn
2008-12-17 18:54 ` Dave Hansen
2008-12-17 19:08 ` Serge E. Hallyn [this message]
2008-12-17 19:08 ` Serge E. Hallyn
2008-12-17 21:25 ` Sukadev Bhattiprolu
[not found] ` <20081217212521.GA14740-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-12-18 21:36 ` Serge E. Hallyn
2008-12-18 21:36 ` Serge E. Hallyn
2008-12-17 17:57 ` [LTP PATCH 1/4] posix message queue namespaces: first test Serge E. Hallyn
2008-12-17 17:57 ` [LTP PATCH 2/4] posix mqns: test parent to child mq access Serge E. Hallyn
2008-12-17 17:58 ` [LTP PATCH 3/4] posix mqns: test vfs and mq interaction Serge E. Hallyn
2008-12-17 17:58 ` [LTP PATCH 4/4] posix mqns: test that user mount of posixmq survivies the ipcns Serge E. Hallyn
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=20081217190826.GA25890@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=dave-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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.