public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel•org>
To: Li Zefan <lizefan@huawei•com>
Cc: Li Zhong <zhong@linux•vnet.ibm.com>,
	linux-next list <linux-next@vger•kernel.org>
Subject: Re: [RFC PATCH next]cgroup: use css_get() in cgroup_create() to check CSS_ROOT
Date: Fri, 16 Aug 2013 10:58:05 -0400	[thread overview]
Message-ID: <20130816145805.GE2505@htj.dyndns.org> (raw)
In-Reply-To: <520DFBF2.5050903@huawei.com>

On Fri, Aug 16, 2013 at 06:16:18PM +0800, Li Zefan wrote:
> 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>

Heh, this doesn't trigger on my test setup for some reason.  Applied.
Thanks a lot.

-- 
tejun

      reply	other threads:[~2013-08-16 14:58 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
2013-08-16 14:58   ` Tejun Heo [this message]

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=20130816145805.GE2505@htj.dyndns.org \
    --to=tj@kernel$(echo .)org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=lizefan@huawei$(echo .)com \
    --cc=zhong@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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