From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty()
Date: Wed, 09 Jan 2013 13:37:38 +0100 [thread overview]
Message-ID: <50ED6492.5070400@redhat.com> (raw)
In-Reply-To: <1357733486-1742-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Hi,
Self-nack, looks like I posted this series too soon. With a config which actually
has CGROUP controllers enabled this causes a panic, so looks like I need to do some
more work on this.
Feedback on this issue is still appreciated.
Regards,
Hans
On 01/09/2013 01:11 PM, Hans de Goede wrote:
> As indicated in the comment above cgroup_css_sets_empty the
> css_set_lock must be hold when calling it.
>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/cgroup.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index c908354..59e711a 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3980,7 +3980,10 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
> /* the vfs holds both inode->i_mutex already */
> again:
> mutex_lock(&cgroup_mutex);
> - if (!cgroup_css_sets_empty(cgrp)) {
> + read_lock(&css_set_lock);
> + ret = cgroup_css_sets_empty(cgrp);
> + read_unlock(&css_set_lock);
> + if (!ret) {
> mutex_unlock(&cgroup_mutex);
> return -EBUSY;
> }
>
next prev parent reply other threads:[~2013-01-09 12:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 12:11 [PATCH 3.4 0/2] 2 bug fixes for the 3.4 cgroup code Hans de Goede
[not found] ` <1357733486-1742-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 12:11 ` [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty() Hans de Goede
[not found] ` <1357733486-1742-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 12:37 ` Hans de Goede [this message]
2013-01-09 12:11 ` [PATCH 3.4 2/2] cgroup: Fix use after free of cgrp (cgrp->css_sets) Hans de Goede
2013-01-09 14:38 ` [PATCH 3.4 0/2] 2 bug fixes for the 3.4 cgroup code Tejun Heo
[not found] ` <20130109143850.GG3926-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2013-01-09 14:48 ` Hans de Goede
[not found] ` <50ED8347.7000806-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 15:39 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2013-01-09 15:03 2 bug fixes for the 3.4 cgroup code (v2) Hans de Goede
[not found] ` <1357743822-21707-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 15:03 ` [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty() Hans de Goede
[not found] ` <1357743822-21707-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-10 2:43 ` Li Zefan
[not found] ` <50EE2ABD.5070404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-01-10 8:49 ` Hans de Goede
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=50ED6492.5070400@redhat.com \
--to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).