diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index f76566f7e..c818014ee 100755 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2639,8 +2639,12 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, struct bfq_queue *in_service_bfqq, *new_bfqq; /* if a merge has already been setup, then proceed with that first */ - if (bfqq->new_bfqq) - return bfqq->new_bfqq; + new_bfqq = bfqq->new_bfqq; + if (new_bfqq) { + while (new_bfqq->new_bfqq) + new_bfqq = new_bfqq->new_bfqq; + return new_bfqq; + } /* * Do not perform queue merging if the device is non