[PATCH] CFQ: request <-> request merging rr_list fixup

In very rare circumstances would we be pruning a merged request and at
the same time delete the implicated cfqq from the rr_list, and not readd
it when the merged request got added. This could cause io stalls until
that process issued io again.

Fix it up by putting the rr_list add handling into cfq_add_rq_rb(),
identical to how pruning is handled in cfq_del_rq_rb(). This fixes a
hang reproducible with fsx-linux.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jens Axboe and committed by
Linus Torvalds
5fccbf61 eafa6cb1

+3 -3
+3 -3
block/cfq-iosched.c
··· 456 456 */ 457 457 while ((__alias = elv_rb_add(&cfqq->sort_list, rq)) != NULL) 458 458 cfq_dispatch_insert(cfqd->queue, __alias); 459 + 460 + if (!cfq_cfqq_on_rr(cfqq)) 461 + cfq_add_cfqq_rr(cfqd, cfqq); 459 462 } 460 463 461 464 static inline void ··· 1654 1651 cfq_init_prio_data(cfqq); 1655 1652 1656 1653 cfq_add_rq_rb(rq); 1657 - 1658 - if (!cfq_cfqq_on_rr(cfqq)) 1659 - cfq_add_cfqq_rr(cfqd, cfqq); 1660 1654 1661 1655 list_add_tail(&rq->queuelist, &cfqq->fifo); 1662 1656