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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 6ce36ff98a41..3dc60fc441cb 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -285,6 +285,13 @@ static void blkg_destroy_all(struct request_queue *q)
285 blkg_destroy(blkg); 285 blkg_destroy(blkg);
286 spin_unlock(&blkcg->lock); 286 spin_unlock(&blkcg->lock);
287 } 287 }
288
289 /*
290 * root blkg is destroyed. Just clear the pointer since
291 * root_rl does not take reference on root blkg.
292 */
293 q->root_blkg = NULL;
294 q->root_rl.blkg = NULL;
288} 295}
289 296
290static void blkg_rcu_free(struct rcu_head *rcu_head) 297static void blkg_rcu_free(struct rcu_head *rcu_head)
@@ -326,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct request_list *rl,
326 */ 333 */
327 if (rl == &q->root_rl) { 334 if (rl == &q->root_rl) {
328 ent = &q->blkg_list; 335 ent = &q->blkg_list;
336 /* There are no more block groups, hence no request lists */
337 if (list_empty(ent))
338 return NULL;
329 } else { 339 } else {
330 blkg = container_of(rl, struct blkcg_gq, rl); 340 blkg = container_of(rl, struct blkcg_gq, rl);
331 ent = &blkg->q_node; 341 ent = &blkg->q_node;