diff options
-rw-r--r-- | block/blk-cgroup.c | 8 | ||||
-rw-r--r-- | block/cfq-iosched.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 5fe03def34b2..2cc682b860ea 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -286,16 +286,16 @@ done: | |||
286 | static struct cgroup_subsys_state * | 286 | static struct cgroup_subsys_state * |
287 | blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup) | 287 | blkiocg_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); |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 838834be115b..5f127cfb2e92 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -3694,8 +3694,10 @@ static void *cfq_init_queue(struct request_queue *q) | |||
3694 | * to make sure that cfq_put_cfqg() does not try to kfree root group | 3694 | * to make sure that cfq_put_cfqg() does not try to kfree root group |
3695 | */ | 3695 | */ |
3696 | atomic_set(&cfqg->ref, 1); | 3696 | atomic_set(&cfqg->ref, 1); |
3697 | rcu_read_lock(); | ||
3697 | blkiocg_add_blkio_group(&blkio_root_cgroup, &cfqg->blkg, (void *)cfqd, | 3698 | blkiocg_add_blkio_group(&blkio_root_cgroup, &cfqg->blkg, (void *)cfqd, |
3698 | 0); | 3699 | 0); |
3700 | rcu_read_unlock(); | ||
3699 | #endif | 3701 | #endif |
3700 | /* | 3702 | /* |
3701 | * Not strictly needed (since RB_ROOT just clears the node and we | 3703 | * Not strictly needed (since RB_ROOT just clears the node and we |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 44bf6d11197e..d48a1dfd7b24 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -235,7 +235,7 @@ void drbd_endio_pri(struct bio *bio, int error) | |||
235 | if (unlikely(error)) { | 235 | if (unlikely(error)) { |
236 | what = (bio_data_dir(bio) == WRITE) | 236 | what = (bio_data_dir(bio) == WRITE) |
237 | ? write_completed_with_error | 237 | ? write_completed_with_error |
238 | : (bio_rw(bio) == READA) | 238 | : (bio_rw(bio) == READ) |
239 | ? read_completed_with_error | 239 | ? read_completed_with_error |
240 | : read_ahead_completed_with_error; | 240 | : read_ahead_completed_with_error; |
241 | } else | 241 | } else |