Commit a8d55ff5 authored by David Wang's avatar David Wang Committed by Tejun Heo

kernel/cgroup: cleanup cgroup_base_files when fail to add cgroup_psi_files

Even though css_clear_dir would be called to cleanup
all existing cgroup files when css_populate_dir failed,
reclaiming newly created cgroup files before
css_populate_dir returns with failure makes code more
consistent.
Signed-off-by: default avatarDavid Wang <00107082@163.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 9f34c566
...@@ -1744,8 +1744,11 @@ static int css_populate_dir(struct cgroup_subsys_state *css) ...@@ -1744,8 +1744,11 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
if (cgroup_psi_enabled()) { if (cgroup_psi_enabled()) {
ret = cgroup_addrm_files(css, cgrp, ret = cgroup_addrm_files(css, cgrp,
cgroup_psi_files, true); cgroup_psi_files, true);
if (ret < 0) if (ret < 0) {
cgroup_addrm_files(css, cgrp,
cgroup_base_files, false);
return ret; return ret;
}
} }
} else { } else {
ret = cgroup_addrm_files(css, cgrp, ret = cgroup_addrm_files(css, cgrp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment