aboutsummaryrefslogtreecommitdiffstats
path: root/block/ll_rw_blk.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-06-19 03:09:27 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-07-10 02:03:32 -0400
commit32eef964110985c5845472e07fa0a18838a970c4 (patch)
tree69a96d9757c72800e3d6479927e00316a4483361 /block/ll_rw_blk.c
parent7deeed13170e634adc4552ff94588d6301a3da83 (diff)
blk_hw_contig_segment(): bad segment size checks
Two bugs in there: - The virt oversize check should use the current bio hardware back size and the next bio front size, not the same bio. Spotted by Neil Brown. - The segment size check should add hw front sizes, not total bio sizes. Spotted by James Bottomley Acked-by: James Bottomley <James.Bottomley@SteelEye.com> Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r--block/ll_rw_blk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index c99b46354859..3e7801e49033 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1304,9 +1304,9 @@ static int blk_hw_contig_segment(request_queue_t *q, struct bio *bio,
1304 if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID))) 1304 if (unlikely(!bio_flagged(nxt, BIO_SEG_VALID)))
1305 blk_recount_segments(q, nxt); 1305 blk_recount_segments(q, nxt);
1306 if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) || 1306 if (!BIOVEC_VIRT_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)) ||
1307 BIOVEC_VIRT_OVERSIZE(bio->bi_hw_front_size + bio->bi_hw_back_size)) 1307 BIOVEC_VIRT_OVERSIZE(bio->bi_hw_back_size + nxt->bi_hw_front_size))
1308 return 0; 1308 return 0;
1309 if (bio->bi_size + nxt->bi_size > q->max_segment_size) 1309 if (bio->bi_hw_back_size + nxt->bi_hw_front_size > q->max_segment_size)
1310 return 0; 1310 return 0;
1311 1311
1312 return 1; 1312 return 1;