aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorShaohua Li2012-11-06 05:39:51 -0600
committerJens Axboe2012-11-06 05:39:51 -0600
commit3d106fba2e7eb6967b1e2cc147a6894ec4307cef (patch)
tree6e812a7d199557452117ed5e53c98e20cf33f893 /block
parent3d70f8c617a436c7146ecb81df2265b4626dfe89 (diff)
downloadkernel-video-3d106fba2e7eb6967b1e2cc147a6894ec4307cef.tar.gz
kernel-video-3d106fba2e7eb6967b1e2cc147a6894ec4307cef.tar.xz
kernel-video-3d106fba2e7eb6967b1e2cc147a6894ec4307cef.zip
block CFQ: avoid moving request to different queue
request is queued in cfqq->fifo list. Looks it's possible we are moving a request from one cfqq to another in request merge case. In such case, adjusting the fifo list order doesn't make sense and is impossible if we don't iterate the whole fifo list. My test does hit one case the two cfqq are different, but didn't cause kernel crash, maybe it's because fifo list isn't used frequently. Anyway, from the code logic, this is buggy. I thought we can re-enable the recusive merge logic after this is fixed. Signed-off-by: Shaohua Li <shli@fusionio.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index fb52df9744f..e62e9205b80 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1973,7 +1973,8 @@ cfq_merged_requests(struct request_queue *q, struct request *rq,
1973 * reposition in fifo if next is older than rq 1973 * reposition in fifo if next is older than rq
1974 */ 1974 */
1975 if (!list_empty(&rq->queuelist) && !list_empty(&next->queuelist) && 1975 if (!list_empty(&rq->queuelist) && !list_empty(&next->queuelist) &&
1976 time_before(rq_fifo_time(next), rq_fifo_time(rq))) { 1976 time_before(rq_fifo_time(next), rq_fifo_time(rq)) &&
1977 cfqq == RQ_CFQQ(next)) {
1977 list_move(&rq->queuelist, &next->queuelist); 1978 list_move(&rq->queuelist, &next->queuelist);
1978 rq_set_fifo_time(rq, rq_fifo_time(next)); 1979 rq_set_fifo_time(rq, rq_fifo_time(next));
1979 } 1980 }