Re: [RFC PATCH next]cgroup: use css_get() in cgroup_create() to check CSS_ROOT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux