Thread (5 messages) 5 messages, 1 author, 2005-05-10
DORMANTno replies

[PATCH md 001 of 4] Fix spliting of md/linear request that cross a device boundary

From: NeilBrown <hidden>
Date: 2005-05-10 05:04:02

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 <redacted>

### Diffstat output
 ./drivers/md/linear.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff ./drivers/md/linear.c~current~ ./drivers/md/linear.c
--- ./drivers/md/linear.c~current~	2005-05-10 14:25:28.000000000 +1000
+++ ./drivers/md/linear.c	2005-05-10 14:26:45.000000000 +1000
@@ -269,9 +269,8 @@ static int linear_make_request (request_
 		 * 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))
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help