X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=block%2Fblk-cgroup.c;h=d0b770391ad400ad0312049c84a2b522bf985bf1;hb=f5f165418cabf2218eb466c0e94693b8b1aee88b;hp=cafcd743118969daec377f52f09e41594d188347;hpb=068a565afad3ae818cc0d5495479c4abccc7762c;p=pandora-kernel.git diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index cafcd7431189..d0b770391ad4 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -285,6 +285,13 @@ static void blkg_destroy_all(struct request_queue *q) blkg_destroy(blkg); spin_unlock(&blkcg->lock); } + + /* + * root blkg is destroyed. Just clear the pointer since + * root_rl does not take reference on root blkg. + */ + q->root_blkg = NULL; + q->root_rl.blkg = NULL; } static void blkg_rcu_free(struct rcu_head *rcu_head) @@ -326,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct request_list *rl, */ if (rl == &q->root_rl) { ent = &q->blkg_list; + /* There are no more block groups, hence no request lists */ + if (list_empty(ent)) + return NULL; } else { blkg = container_of(rl, struct blkcg_gq, rl); ent = &blkg->q_node;