Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth

From: KAMEZAWA Hiroyuki
Date: Sun May 30 2010 - 19:49:58 EST


On Fri, 28 May 2010 15:25:08 -0700
Paul Menage <menage@xxxxxxxxxx> wrote:

> On Fri, May 28, 2010 at 8:16 AM, Greg Thelen <gthelen@xxxxxxxxxx> wrote:
> >
> > Signed-off-by: Greg Thelen <gthelen@xxxxxxxxxx>
>
> Acked-by: Paul Menage <menage@xxxxxxxxxx>
>
> Good catch, thanks.
>
Nice Catch.
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

But, who breaks this ? Do we need backport this against old kernels ?

2.6.33 has this.
> 3959 depth = css_depth(parent_css) + 1;
> 3960 parent_id = parent_css->id;
> 3961
> 3962 child_id = get_new_cssid(ss, depth);


Thanks,
-Kame


> Paul
>
> > ---
> > Âkernel/cgroup.c | Â Â2 +-
> > Â1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> > index 422cb19..3ac6f5b 100644
> > --- a/kernel/cgroup.c
> > +++ b/kernel/cgroup.c
> > @@ -4598,7 +4598,7 @@ static int alloc_css_id(struct cgroup_subsys *ss, struct cgroup *parent,
> > Â Â Â Âparent_css = parent->subsys[subsys_id];
> > Â Â Â Âchild_css = child->subsys[subsys_id];
> > Â Â Â Âparent_id = parent_css->id;
> > - Â Â Â depth = parent_id->depth;
> > + Â Â Â depth = parent_id->depth + 1;
> >
> > Â Â Â Âchild_id = get_new_cssid(ss, depth);
> > Â Â Â Âif (IS_ERR(child_id))
> > --
> > 1.7.0.1
> >
> >
>

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