diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index fede3d3f28ff..0dfc7324c789 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1487,6 +1487,7 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type, | |||
1487 | struct cgroup_sb_opts opts; | 1487 | struct cgroup_sb_opts opts; |
1488 | struct dentry *dentry; | 1488 | struct dentry *dentry; |
1489 | int ret; | 1489 | int ret; |
1490 | bool new_sb; | ||
1490 | 1491 | ||
1491 | /* | 1492 | /* |
1492 | * The first time anyone tries to mount a cgroup, enable the list | 1493 | * The first time anyone tries to mount a cgroup, enable the list |
@@ -1603,8 +1604,8 @@ out_unlock: | |||
1603 | if (ret) | 1604 | if (ret) |
1604 | return ERR_PTR(ret); | 1605 | return ERR_PTR(ret); |
1605 | 1606 | ||
1606 | dentry = kernfs_mount(fs_type, flags, root->kf_root, NULL); | 1607 | dentry = kernfs_mount(fs_type, flags, root->kf_root, &new_sb); |
1607 | if (IS_ERR(dentry)) | 1608 | if (IS_ERR(dentry) || !new_sb) |
1608 | cgroup_put(&root->cgrp); | 1609 | cgroup_put(&root->cgrp); |
1609 | return dentry; | 1610 | return dentry; |
1610 | } | 1611 | } |