Messages in this thread Patch in this message | | | Date | Wed, 20 Nov 2002 02:28:47 +0100 | From | Thorbjørn Lind <> | Subject | [patch] 2.5.48-bk, md raid0 fix |
| |
Fixes the 'BUG at drivers/block/ll_rw_blk.c:19xx' when using raid0 md devices since 2.5.45...
/tul
--- a/drivers/md/raid0.c 2002-11-18 05:29:46.000000000 +0100 +++ b/drivers/md/raid0.c 2002-11-20 01:12:08.000000000 +0100 @@ -173,15 +173,14 @@ static int raid0_mergeable_bvec(request_queue_t *q, struct bio *bio, struct bio_vec *biovec) { mddev_t *mddev = q->queuedata; - sector_t block; - unsigned int chunk_size; - unsigned int bio_sz; - - chunk_size = mddev->chunk_size >> 10; - block = bio->bi_sector >> 1; - bio_sz = (bio->bi_size + biovec->bv_len) >> 10; - - return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10; + unsigned int max_size; + + max_size = mddev->chunk_size - ((bio->bi_sector % (mddev->chunk_size >> 9)) << 9); + + if(biovec->bv_len <= (max_size - bio->bi_size)) + return biovec->bv_len; + + return max_size - bio->bi_size; }
static int raid0_run (mddev_t *mddev) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |