diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-05-17 00:53:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:11 -0400 |
commit | 29ac8e056f2016a8404edc02749d095019aa1f82 (patch) | |
tree | e397738144d80b3c3d78edde36ab739892f4d3dc /drivers | |
parent | 8f332287bc3f2801ba43682fd79baf24dc8ac1ce (diff) |
[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: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/linear.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 161e9aa87291..b1941b887f46 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -269,9 +269,8 @@ static int linear_make_request (request_queue_t *q, struct bio *bio) | |||
269 | * split it. | 269 | * split it. |
270 | */ | 270 | */ |
271 | struct bio_pair *bp; | 271 | struct bio_pair *bp; |
272 | bp = bio_split(bio, bio_split_pool, | 272 | bp = bio_split(bio, bio_split_pool, |
273 | (bio->bi_sector + (bio->bi_size >> 9) - | 273 | ((tmp_dev->offset + tmp_dev->size)<<1) - bio->bi_sector); |
274 | (tmp_dev->offset + tmp_dev->size))<<1); | ||
275 | if (linear_make_request(q, &bp->bio1)) | 274 | if (linear_make_request(q, &bp->bio1)) |
276 | generic_make_request(&bp->bio1); | 275 | generic_make_request(&bp->bio1); |
277 | if (linear_make_request(q, &bp->bio2)) | 276 | if (linear_make_request(q, &bp->bio2)) |