]> git.baikalelectronics.ru Git - kernel.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)
committerTejun Heo <tj@kernel.org>
Thu, 26 May 2016 19:09:23 +0000 (15:09 -0400)
commit0855cc39e9c4ff88b53a4daeebdf71d60a2f48bb
tree458e49e47efd51634d11c09d00e10f147e47f1e1
parent8e088d1213011b12048fd8268b6f8673dc0a6e3e
cgroup: remove redundant cleanup in css_create

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: 84c0fa3f380f ("percpu-refcount: require percpu_ref to be exited explicitly")
Fixes: 70cceabdc5ef ("cgroup: release css->id after css_free")
Cc: stable@vger.kernel.org # v3.17+
kernel/cgroup.c