
From: Kevin Corry <kevcorry@us.ibm.com>

In stripe_map(), change chunk to 64-bit and use do_div to divide and mod by
the number of stripes.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/md/dm-stripe.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff -puN drivers/md/dm-stripe.c~device-mapper-fix-tb-stripe-data-corruption drivers/md/dm-stripe.c
--- 25/drivers/md/dm-stripe.c~device-mapper-fix-tb-stripe-data-corruption	2005-01-22 23:50:23.111567320 -0800
+++ 25-akpm/drivers/md/dm-stripe.c	2005-01-22 23:50:23.114566864 -0800
@@ -173,9 +173,8 @@ static int stripe_map(struct dm_target *
 	struct stripe_c *sc = (struct stripe_c *) ti->private;
 
 	sector_t offset = bio->bi_sector - ti->begin;
-	uint32_t chunk = (uint32_t) (offset >> sc->chunk_shift);
-	uint32_t stripe = chunk % sc->stripes;	/* 32bit modulus */
-	chunk = chunk / sc->stripes;
+	sector_t chunk = offset >> sc->chunk_shift;
+	uint32_t stripe = do_div(chunk, sc->stripes);
 
 	bio->bi_bdev = sc->stripe[stripe].dev->bdev;
 	bio->bi_sector = sc->stripe[stripe].physical_start +
@@ -210,7 +209,7 @@ static int stripe_status(struct dm_targe
 
 static struct target_type stripe_target = {
 	.name   = "striped",
-	.version= {1, 0, 1},
+	.version= {1, 0, 2},
 	.module = THIS_MODULE,
 	.ctr    = stripe_ctr,
 	.dtr    = stripe_dtr,
_
