diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 9fcdaa705b6c..ceee0c54c6a4 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/init_task.h> | 33 | #include <linux/init_task.h> |
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/list.h> | 35 | #include <linux/list.h> |
36 | #include <linux/magic.h> | ||
36 | #include <linux/mm.h> | 37 | #include <linux/mm.h> |
37 | #include <linux/mutex.h> | 38 | #include <linux/mutex.h> |
38 | #include <linux/mount.h> | 39 | #include <linux/mount.h> |
@@ -348,7 +349,7 @@ struct cgrp_cset_link { | |||
348 | * reference-counted, to improve performance when child cgroups | 349 | * reference-counted, to improve performance when child cgroups |
349 | * haven't been created. | 350 | * haven't been created. |
350 | */ | 351 | */ |
351 | static struct css_set init_css_set = { | 352 | struct css_set init_css_set = { |
352 | .refcount = ATOMIC_INIT(1), | 353 | .refcount = ATOMIC_INIT(1), |
353 | .cgrp_links = LIST_HEAD_INIT(init_css_set.cgrp_links), | 354 | .cgrp_links = LIST_HEAD_INIT(init_css_set.cgrp_links), |
354 | .tasks = LIST_HEAD_INIT(init_css_set.tasks), | 355 | .tasks = LIST_HEAD_INIT(init_css_set.tasks), |
@@ -1495,7 +1496,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, | |||
1495 | */ | 1496 | */ |
1496 | if (!use_task_css_set_links) | 1497 | if (!use_task_css_set_links) |
1497 | cgroup_enable_task_cg_lists(); | 1498 | cgroup_enable_task_cg_lists(); |
1498 | retry: | 1499 | |
1499 | mutex_lock(&cgroup_tree_mutex); | 1500 | mutex_lock(&cgroup_tree_mutex); |
1500 | mutex_lock(&cgroup_mutex); | 1501 | mutex_lock(&cgroup_mutex); |
1501 | 1502 | ||
@@ -1503,7 +1504,7 @@ retry: | |||
1503 | ret = parse_cgroupfs_options(data, &opts); | 1504 | ret = parse_cgroupfs_options(data, &opts); |
1504 | if (ret) | 1505 | if (ret) |
1505 | goto out_unlock; | 1506 | goto out_unlock; |
1506 | 1507 | retry: | |
1507 | /* look for a matching existing root */ | 1508 | /* look for a matching existing root */ |
1508 | if (!opts.subsys_mask && !opts.none && !opts.name) { | 1509 | if (!opts.subsys_mask && !opts.none && !opts.name) { |
1509 | cgrp_dfl_root_visible = true; | 1510 | cgrp_dfl_root_visible = true; |
@@ -1562,9 +1563,9 @@ retry: | |||
1562 | if (!atomic_inc_not_zero(&root->cgrp.refcnt)) { | 1563 | if (!atomic_inc_not_zero(&root->cgrp.refcnt)) { |
1563 | mutex_unlock(&cgroup_mutex); | 1564 | mutex_unlock(&cgroup_mutex); |
1564 | mutex_unlock(&cgroup_tree_mutex); | 1565 | mutex_unlock(&cgroup_tree_mutex); |
1565 | kfree(opts.release_agent); | ||
1566 | kfree(opts.name); | ||
1567 | msleep(10); | 1566 | msleep(10); |
1567 | mutex_lock(&cgroup_tree_mutex); | ||
1568 | mutex_lock(&cgroup_mutex); | ||
1568 | goto retry; | 1569 | goto retry; |
1569 | } | 1570 | } |
1570 | 1571 | ||
@@ -1604,7 +1605,8 @@ out_unlock: | |||
1604 | if (ret) | 1605 | if (ret) |
1605 | return ERR_PTR(ret); | 1606 | return ERR_PTR(ret); |
1606 | 1607 | ||
1607 | dentry = kernfs_mount(fs_type, flags, root->kf_root, &new_sb); | 1608 | dentry = kernfs_mount(fs_type, flags, root->kf_root, |
1609 | CGROUP_SUPER_MAGIC, &new_sb); | ||
1608 | if (IS_ERR(dentry) || !new_sb) | 1610 | if (IS_ERR(dentry) || !new_sb) |
1609 | cgroup_put(&root->cgrp); | 1611 | cgroup_put(&root->cgrp); |
1610 | return dentry; | 1612 | return dentry; |