• Li Zefan's avatar
    cgroup: fix bogus kernel warnings when cgroup_create() failed · 2739d3cc
    Li Zefan authored
    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: default avatarLi Zefan <lizefan@huawei.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    2739d3cc
cgroup.c 148 KB