Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e58e1ca4 authored by Tejun Heo's avatar Tejun Heo
Browse files

Merge branch 'for-3.13-fixes' into for-3.14



Pulling in as patches depending on 266ccd50 ("cgroup: fix
cgroup_create() error handling path") are scheduled.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parents 6612f05b 266ccd50
Loading
Loading
Loading
Loading
+21 −10
Original line number Diff line number Diff line
@@ -4162,14 +4162,6 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
	list_add_tail_rcu(&cgrp->sibling, &cgrp->parent->children);
	root->number_of_cgroups++;

	/* each css holds a ref to the cgroup's dentry and the parent css */
	for_each_root_subsys(root, ss) {
		struct cgroup_subsys_state *css = css_ar[ss->subsys_id];

		dget(dentry);
		css_get(css->parent);
	}

	/* hold a ref to the parent's dentry */
	dget(parent->dentry);

@@ -4181,6 +4173,13 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
		if (err)
			goto err_destroy;

		/* each css holds a ref to the cgroup's dentry and parent css */
		dget(dentry);
		css_get(css->parent);

		/* mark it consumed for error path */
		css_ar[ss->subsys_id] = NULL;

		if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
		    parent->parent) {
			pr_warning("cgroup: %s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
@@ -4227,6 +4226,14 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
	return err;

err_destroy:
	for_each_root_subsys(root, ss) {
		struct cgroup_subsys_state *css = css_ar[ss->subsys_id];

		if (css) {
			percpu_ref_cancel_init(&css->refcnt);
			ss->css_free(css);
		}
	}
	cgroup_destroy_locked(cgrp);
	mutex_unlock(&cgroup_mutex);
	mutex_unlock(&dentry->d_inode->i_mutex);
@@ -4387,8 +4394,12 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
	 * will be invoked to perform the rest of destruction once the
	 * percpu refs of all css's are confirmed to be killed.
	 */
	for_each_root_subsys(cgrp->root, ss)
		kill_css(cgroup_css(cgrp, ss));
	for_each_root_subsys(cgrp->root, ss) {
		struct cgroup_subsys_state *css = cgroup_css(cgrp, ss);

		if (css)
			kill_css(css);
	}

	/*
	 * Mark @cgrp dead.  This prevents further task migration and child