cgroup: fix bogus kernel warnings when cgroup_create() failed
authorLi Zefan <lizefan@huawei.com>
Mon, 21 Jan 2013 10:18:33 +0000 (18:18 +0800)
committerTejun Heo <tj@kernel.org>
Wed, 23 Jan 2013 00:29:07 +0000 (16:29 -0800)
commit2739d3cce9816805fe26774fea2527d5b16e924d
treede9fa4a5d6090835a551cea82c09a146d391f37e
parent130e3695a3edf6bf21464f2826720a79a6afdee0
cgroup: fix bogus kernel warnings when cgroup_create() failed

If cgroup_create() failed and cgroup_destroy_locked() is called to
do cleanup, we'll see a bunch of warnings:

cgroup_addrm_files: failed to remove 2MB.limit_in_bytes, err=-2
cgroup_addrm_files: failed to remove 2MB.usage_in_bytes, err=-2
cgroup_addrm_files: failed to remove 2MB.max_usage_in_bytes, err=-2
cgroup_addrm_files: failed to remove 2MB.failcnt, err=-2
cgroup_addrm_files: failed to remove prioidx, err=-2
cgroup_addrm_files: failed to remove ifpriomap, err=-2
...

We failed to remove those files, because cgroup_create() has failed
before creating those cgroup files.

To fix this, we simply don't warn if cgroup_rm_file() can't find the
cft entry.

Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c