aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-10-15 17:00:43 -0400
committerAlex Shi <alex.shi@linaro.org>2016-06-08 11:09:28 +0800
commit20ccd00c1cb1ed260fc3e4ce880c90f71ded9b82 (patch)
treee5ff308ef394a3d1c9ba0c34f060d75dda349b8c
parent93e7f39790635745a8833b6ba8a4edd529a01292 (diff)
cgroup: replace error handling in cgroup_init() with WARN_ON()s
The init sequence shouldn't fail short of bugs and even when it does it's better to continue with the rest of initialization and we were silently ignoring /proc/cgroups creation failure. Drop the explicit error handling and wrap sysfs_create_mount_point(), register_filesystem() and proc_create() with WARN_ON()s. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Cc: Johannes Weiner <hannes@cmpxchg.org> (cherry picked from commit 035f4f510583193949168c77dc957293df24bd77) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--kernel/cgroup.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c67f3785c6a7..18b9fe70339a 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5242,7 +5242,7 @@ int __init cgroup_init(void)
{
struct cgroup_subsys *ss;
unsigned long key;
- int ssid, err;
+ int ssid;
BUG_ON(percpu_init_rwsem(&cgroup_threadgroup_rwsem));
BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files));
@@ -5304,17 +5304,10 @@ int __init cgroup_init(void)
ss->bind(init_css_set.subsys[ssid]);
}
- err = sysfs_create_mount_point(fs_kobj, "cgroup");
- if (err)
- return err;
-
- err = register_filesystem(&cgroup_fs_type);
- if (err < 0) {
- sysfs_remove_mount_point(fs_kobj, "cgroup");
- return err;
- }
+ WARN_ON(sysfs_create_mount_point(fs_kobj, "cgroup"));
+ WARN_ON(register_filesystem(&cgroup_fs_type));
+ WARN_ON(!proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations));
- proc_create("cgroups", 0, NULL, &proc_cgroupstats_operations);
return 0;
}