|
@@ -4185,12 +4185,14 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss)
|
|
if (IS_ERR(css))
|
|
if (IS_ERR(css))
|
|
return PTR_ERR(css);
|
|
return PTR_ERR(css);
|
|
|
|
|
|
|
|
+ init_css(css, ss, cgrp);
|
|
|
|
+ cgroup_get(cgrp);
|
|
|
|
+ css_get(css->parent);
|
|
|
|
+
|
|
err = percpu_ref_init(&css->refcnt, css_release);
|
|
err = percpu_ref_init(&css->refcnt, css_release);
|
|
if (err)
|
|
if (err)
|
|
goto err_free_css;
|
|
goto err_free_css;
|
|
|
|
|
|
- init_css(css, ss, cgrp);
|
|
|
|
-
|
|
|
|
err = cgroup_populate_dir(cgrp, 1 << ss->id);
|
|
err = cgroup_populate_dir(cgrp, 1 << ss->id);
|
|
if (err)
|
|
if (err)
|
|
goto err_free_percpu_ref;
|
|
goto err_free_percpu_ref;
|
|
@@ -4199,9 +4201,6 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss)
|
|
if (err)
|
|
if (err)
|
|
goto err_clear_dir;
|
|
goto err_clear_dir;
|
|
|
|
|
|
- cgroup_get(cgrp);
|
|
|
|
- css_get(css->parent);
|
|
|
|
-
|
|
|
|
if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
|
|
if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
|
|
parent->parent) {
|
|
parent->parent) {
|
|
pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
|
|
pr_warn("%s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
|
|
@@ -4218,7 +4217,7 @@ err_clear_dir:
|
|
err_free_percpu_ref:
|
|
err_free_percpu_ref:
|
|
percpu_ref_cancel_init(&css->refcnt);
|
|
percpu_ref_cancel_init(&css->refcnt);
|
|
err_free_css:
|
|
err_free_css:
|
|
- ss->css_free(css);
|
|
|
|
|
|
+ call_rcu(&css->rcu_head, css_free_rcu_fn);
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|