summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/cfq-iosched.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 96f59ae5b6e9..f3f62394b986 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2151,10 +2151,11 @@ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd)
* have been idling all along on this queue and it should be
* ok to wait for this request to complete.
*/
- if (cfqq->cfqg->nr_cfqq == 1 && cfqq->dispatched
- && cfq_should_idle(cfqd, cfqq))
+ if (cfqq->cfqg->nr_cfqq == 1 && RB_EMPTY_ROOT(&cfqq->sort_list)
+ && cfqq->dispatched && cfq_should_idle(cfqd, cfqq)) {
+ cfqq = NULL;
goto keep_queue;
- else
+ } else
goto expire;
}