aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 5fe03def34b..2cc682b860e 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -286,16 +286,16 @@ done:
286static struct cgroup_subsys_state * 286static struct cgroup_subsys_state *
287blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup) 287blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup)
288{ 288{
289 struct blkio_cgroup *blkcg, *parent_blkcg; 289 struct blkio_cgroup *blkcg;
290 struct cgroup *parent = cgroup->parent;
290 291
291 if (!cgroup->parent) { 292 if (!parent) {
292 blkcg = &blkio_root_cgroup; 293 blkcg = &blkio_root_cgroup;
293 goto done; 294 goto done;
294 } 295 }
295 296
296 /* Currently we do not support hierarchy deeper than two level (0,1) */ 297 /* Currently we do not support hierarchy deeper than two level (0,1) */
297 parent_blkcg = cgroup_to_blkio_cgroup(cgroup->parent); 298 if (parent != cgroup->top_cgroup)
298 if (css_depth(&parent_blkcg->css) > 0)
299 return ERR_PTR(-EINVAL); 299 return ERR_PTR(-EINVAL);
300 300
301 blkcg = kzalloc(sizeof(*blkcg), GFP_KERNEL); 301 blkcg = kzalloc(sizeof(*blkcg), GFP_KERNEL);