diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 17:34:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-26 17:34:17 -0400 |
commit | b55b048718c8c833186c87ceeea86b78346cda2e (patch) | |
tree | 073dd3a3aa3ccb439f467de421a6c59f95c92b79 /kernel/cgroup.c | |
parent | bbce2ad2d711c12d93145a7bbdf086e73f414bcd (diff) | |
parent | 55094f57535831883b60776de5eb78c6bfb3c16d (diff) |
Merge branch 'for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup updates from Tejun Heo:
"Nothing too exciting.
- updates to the pids controller so that pid limit breaches can be
noticed and monitored from userland.
- cleanups and non-critical bug fixes"
* 'for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
cgroup: remove duplicated include from cgroup.c
cgroup: Use lld instead of ld when printing pids controller events_limit
cgroup: Add pids controller event when fork fails because of pid limit
cgroup: allow NULL return from ss->css_alloc()
cgroup: remove unnecessary 0 check from css_from_id()
cgroup: fix idr leak for the first cgroup root
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 75c0ff00aca6..33a2f63d4a10 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -61,7 +61,6 @@ | |||
61 | #include <linux/cpuset.h> | 61 | #include <linux/cpuset.h> |
62 | #include <linux/proc_ns.h> | 62 | #include <linux/proc_ns.h> |
63 | #include <linux/nsproxy.h> | 63 | #include <linux/nsproxy.h> |
64 | #include <linux/proc_ns.h> | ||
65 | #include <net/sock.h> | 64 | #include <net/sock.h> |
66 | 65 | ||
67 | /* | 66 | /* |
@@ -1160,18 +1159,12 @@ static void cgroup_exit_root_id(struct cgroup_root *root) | |||
1160 | { | 1159 | { |
1161 | lockdep_assert_held(&cgroup_mutex); | 1160 | lockdep_assert_held(&cgroup_mutex); |
1162 | 1161 | ||
1163 | if (root->hierarchy_id) { | 1162 | idr_remove(&cgroup_hierarchy_idr, root->hierarchy_id); |
1164 | idr_remove(&cgroup_hierarchy_idr, root->hierarchy_id); | ||
1165 | root->hierarchy_id = 0; | ||
1166 | } | ||
1167 | } | 1163 | } |
1168 | 1164 | ||
1169 | static void cgroup_free_root(struct cgroup_root *root) | 1165 | static void cgroup_free_root(struct cgroup_root *root) |
1170 | { | 1166 | { |
1171 | if (root) { | 1167 | if (root) { |
1172 | /* hierarchy ID should already have been released */ | ||
1173 | WARN_ON_ONCE(root->hierarchy_id); | ||
1174 | |||
1175 | idr_destroy(&root->cgroup_idr); | 1168 | idr_destroy(&root->cgroup_idr); |
1176 | kfree(root); | 1169 | kfree(root); |
1177 | } | 1170 | } |
@@ -5146,6 +5139,8 @@ static struct cgroup_subsys_state *css_create(struct cgroup *cgrp, | |||
5146 | lockdep_assert_held(&cgroup_mutex); | 5139 | lockdep_assert_held(&cgroup_mutex); |
5147 | 5140 | ||
5148 | css = ss->css_alloc(parent_css); | 5141 | css = ss->css_alloc(parent_css); |
5142 | if (!css) | ||
5143 | css = ERR_PTR(-ENOMEM); | ||
5149 | if (IS_ERR(css)) | 5144 | if (IS_ERR(css)) |
5150 | return css; | 5145 | return css; |
5151 | 5146 | ||
@@ -6172,7 +6167,7 @@ struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry, | |||
6172 | struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss) | 6167 | struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss) |
6173 | { | 6168 | { |
6174 | WARN_ON_ONCE(!rcu_read_lock_held()); | 6169 | WARN_ON_ONCE(!rcu_read_lock_held()); |
6175 | return id > 0 ? idr_find(&ss->css_idr, id) : NULL; | 6170 | return idr_find(&ss->css_idr, id); |
6176 | } | 6171 | } |
6177 | 6172 | ||
6178 | /** | 6173 | /** |