Skip to content

Commit

Permalink
[PATCH] md: fix splitting of md/linear request that cross a device bo…
Browse files Browse the repository at this point in the history
…undary

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: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed May 17, 2005
1 parent 8f33228 commit 29ac8e0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/md/linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 29ac8e0

Please sign in to comment.