提交 29ac8e05 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] md: fix splitting of md/linear request that cross a device boundary

When a request crosses a boundary between devices, it needs to be split.
But where we should calculate the amount of the request before the boundary
to find the split-point, we care currently calculating the amount that is
*after* the boundary !!!
Signed-off-by: NNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8f332287
......@@ -269,9 +269,8 @@ static int linear_make_request (request_queue_t *q, struct bio *bio)
* split it.
*/
struct bio_pair *bp;
bp = bio_split(bio, bio_split_pool,
(bio->bi_sector + (bio->bi_size >> 9) -
(tmp_dev->offset + tmp_dev->size))<<1);
bp = bio_split(bio, bio_split_pool,
((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector);
if (linear_make_request(q, &bp->bio1))
generic_make_request(&bp->bio1);
if (linear_make_request(q, &bp->bio2))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册