• Tejun Heo's avatar
    cgroup: simplify cgroup_load_subsys() failure path · d19e19de
    Tejun Heo authored
    Now that cgroup_unload_subsys() can tell whether the root css is
    online or not, we can safely call cgroup_unload_subsys() after idr
    init failure in cgroup_load_subsys().
    
    Replace the manual unrolling and invoke cgroup_unload_subsys() on
    failure.  This drops cgroup_mutex inbetween but should be safe as the
    subsystem will fail try_module_get() and thus can't be mounted
    inbetween.  As this means that cgroup_unload_subsys() can be called
    before css_sets are rehashed, remove BUG_ON() on %NULL
    css_set->subsys[] from cgroup_unload_subsys().
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarLi Zefan <lizefan@huawei.com>
    d19e19de
cgroup.c 146 KB