aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@openvz.org>2011-04-03 18:15:02 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-04-05 17:52:49 -0400
commitf83e826181f7f8fb152e4190d03854fc3a5dd040 (patch)
tree989f440665d529587fcc6365b1968e2b29fb7c94 /block/blk-core.c
parenta63a5cf84dac7a23a57c800eea5734701e7d3c04 (diff)
block: fix request sorting at unplug
Comparison function for list_sort() must be anticommutative, otherwise it is not sorting in ordinary meaning. But fortunately list_sort() always check ((*cmp)(priv, a, b) <= 0) it not distinguish negative and zero, so comparison function can implement only less-or-equal instead of full three-way comparison. Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 4fdf8953efbf..725091d5496d 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2665,7 +2665,7 @@ static int plug_rq_cmp(void *priv, struct list_head *a, struct list_head *b)
2665 struct request *rqa = container_of(a, struct request, queuelist); 2665 struct request *rqa = container_of(a, struct request, queuelist);
2666 struct request *rqb = container_of(b, struct request, queuelist); 2666 struct request *rqb = container_of(b, struct request, queuelist);
2667 2667
2668 return !(rqa->q == rqb->q); 2668 return !(rqa->q <= rqb->q);
2669} 2669}
2670 2670
2671static void flush_plug_list(struct blk_plug *plug) 2671static void flush_plug_list(struct blk_plug *plug)