]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cgroup: remove redundant cleanup in css_create
authorWenwei Tao <ww.tao0320@gmail.com>
Fri, 13 May 2016 14:59:20 +0000 (22:59 +0800)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:21:56 +0000 (17:21 -0500)
commit651f2c68865102454a953cbd2a7418814078ee13
tree88c99a4345df94562e6704ee9c262feac59083b5
parent49aa72176a33d1f3c7ec3776494624136a42dcbd
cgroup: remove redundant cleanup in css_create

Orabug: 25308011

[ Upstream commit b00c52dae6d9ee8d0f2407118ef6544ae5524781 ]

When create css failed, before call css_free_rcu_fn, we remove the css
id and exit the percpu_ref, but we will do these again in
css_free_work_fn, so they are redundant.  Especially the css id, that
would cause problem if we remove it twice, since it may be assigned to
another css after the first remove.

tj: This was broken by two commits updating the free path without
    synchronizing the creation failure path.  This can be easily
    triggered by trying to create more than 64k memory cgroups.

Signed-off-by: Wenwei Tao <ww.tao0320@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Fixes: 9a1049da9bd2 ("percpu-refcount: require percpu_ref to be exited explicitly")
Fixes: 01e586598b22 ("cgroup: release css->id after css_free")
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 6ef304587cf41e19312fa9fd81448ea6880ad475)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
kernel/cgroup.c