aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 20a54b8e03e1..b0b754a6882b 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -584,12 +584,13 @@ cfq_prio_tree_lookup(struct cfq_data *cfqd, int ioprio, sector_t sector,
584 else 584 else
585 break; 585 break;
586 p = n; 586 p = n;
587 cfqq = NULL;
587 } 588 }
588 589
589 *ret_parent = parent; 590 *ret_parent = parent;
590 if (rb_link) 591 if (rb_link)
591 *rb_link = p; 592 *rb_link = p;
592 return NULL; 593 return cfqq;
593} 594}
594 595
595static void cfq_prio_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq) 596static void cfq_prio_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq)
@@ -608,10 +609,10 @@ static void cfq_prio_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq)
608 609
609 __cfqq = cfq_prio_tree_lookup(cfqd, cfqq->ioprio, cfqq->next_rq->sector, 610 __cfqq = cfq_prio_tree_lookup(cfqd, cfqq->ioprio, cfqq->next_rq->sector,
610 &parent, &p); 611 &parent, &p);
611 BUG_ON(__cfqq); 612 if (!__cfqq) {
612 613 rb_link_node(&cfqq->p_node, parent, p);
613 rb_link_node(&cfqq->p_node, parent, p); 614 rb_insert_color(&cfqq->p_node, root);
614 rb_insert_color(&cfqq->p_node, root); 615 }
615} 616}
616 617
617/* 618/*