From: Li Zefan <lizefan@huawei.com>
To: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: linux-next list <linux-next@vger.kernel.org>, Tejun Heo <tj@kernel.org>
Subject: Re: [RFC PATCH next]cgroup: use css_get() in cgroup_create() to check CSS_ROOT
Date: Fri, 16 Aug 2013 18:16:18 +0800 [thread overview]
Message-ID: <520DFBF2.5050903@huawei.com> (raw)
In-Reply-To: <1376647034.2642.22.camel@ThinkPad-T5421>
On 2013/8/16 17:57, Li Zhong wrote:
> It seems that the root css doesn't have refcnt allocated(not needed?),
> and would cause the booting error attached.
>
> This patch tries to use css_get() to not increase the refcnt if parent
> is root.
...
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 723194f..781f8cd 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4485,7 +4485,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
> struct cgroup_subsys_state *css = css_ar[ss->subsys_id];
>
> dget(dentry);
> - percpu_ref_get(&css->parent->refcnt);
> + css_get(css->parent);
We use css_put() to drop this refcnt, so it makes sense to use css_get()
for consistency.
Acked-by: Li Zefan <lizefan@huawei.com>
next prev parent reply other threads:[~2013-08-16 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 9:57 [RFC PATCH next]cgroup: use css_get() in cgroup_create() to check CSS_ROOT Li Zhong
2013-08-16 10:16 ` Li Zefan [this message]
2013-08-16 14:58 ` Tejun Heo
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=520DFBF2.5050903@huawei.com \
--to=lizefan@huawei.com \
--cc=linux-next@vger.kernel.org \
--cc=tj@kernel.org \
--cc=zhong@linux.vnet.ibm.com \
/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.