Skip to content

Commit 48fe37c

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: blk-cgroup: Fix an RCU warning in blkiocg_create() blk-cgroup: Fix RCU correctness warning in cfq_init_queue() drbd: don't expose failed local READ to upper layers
2 parents e33b3e7 + 0341509 commit 48fe37c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

block/blk-cgroup.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup)
286286
static struct cgroup_subsys_state *
287287
blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup)
288288
{
289-
struct blkio_cgroup *blkcg, *parent_blkcg;
289+
struct blkio_cgroup *blkcg;
290+
struct cgroup *parent = cgroup->parent;
290291

291-
if (!cgroup->parent) {
292+
if (!parent) {
292293
blkcg = &blkio_root_cgroup;
293294
goto done;
294295
}
295296

296297
/* Currently we do not support hierarchy deeper than two level (0,1) */
297-
parent_blkcg = cgroup_to_blkio_cgroup(cgroup->parent);
298-
if (css_depth(&parent_blkcg->css) > 0)
298+
if (parent != cgroup->top_cgroup)
299299
return ERR_PTR(-EINVAL);
300300

301301
blkcg = kzalloc(sizeof(*blkcg), GFP_KERNEL);

block/cfq-iosched.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3694,8 +3694,10 @@ static void *cfq_init_queue(struct request_queue *q)
36943694
* to make sure that cfq_put_cfqg() does not try to kfree root group
36953695
*/
36963696
atomic_set(&cfqg->ref, 1);
3697+
rcu_read_lock();
36973698
blkiocg_add_blkio_group(&blkio_root_cgroup, &cfqg->blkg, (void *)cfqd,
36983699
0);
3700+
rcu_read_unlock();
36993701
#endif
37003702
/*
37013703
* Not strictly needed (since RB_ROOT just clears the node and we

drivers/block/drbd/drbd_worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void drbd_endio_pri(struct bio *bio, int error)
235235
if (unlikely(error)) {
236236
what = (bio_data_dir(bio) == WRITE)
237237
? write_completed_with_error
238-
: (bio_rw(bio) == READA)
238+
: (bio_rw(bio) == READ)
239239
? read_completed_with_error
240240
: read_ahead_completed_with_error;
241241
} else

0 commit comments

Comments
 (0)