Re: [PATCH] cgroups: add lock for child->cgroups in cgroup_post_fork()

From: Paul Menage
Date: Fri Nov 21 2008 - 12:59:21 EST


On Fri, Nov 21, 2008 at 12:49 AM, Lai Jiangshan <laijs@xxxxxxxxxxxxxx> wrote:
> when cgroup_post_fork() called, child is seen by find_task_by_vpid(),
> so child->cgroups maybe be changed, It'll incorrect.
>
> child->cgroups<old>'s refcnt is decreased
> child->cgroups<new>'s refcnt is increased
> but child->cg_list is added to child->cgroups<old>'s list.
>
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>

Reviewed-by: Paul Menage <menage@xxxxxxxxxx>

Yeah, I guess this was a place where I equated "holding css_set_lock"
with "cgroups can't change". But in fact they can partially change.

Paul
--
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/