Re: raid-0 BUG in 2.5.46-bk4

From: Neil Brown (neilb@cse.unsw.edu.au)
Date: Fri Nov 08 2002 - 19:10:12 EST


On Friday November 8, helge.hafting@broadpark.no wrote:
> I installed 2.5.46-bk4 in order to try the new
> raid patches. (I have raid-1 and raid-0
> on smp, scsi)
>
> Raid-1 seems to work fine, but processes
> trying to use the raid-0 (/usr/src)
> either segfaults or gets stuck in D-state
> quickly.
...
> ------------[ cut here ]------------
> kernel BUG at drivers/block/ll_rw_blk.c:1949!
....
> [<c016f1d6>] mpage_bio_submit+0x22/0x28
> [<c016f4a7>] do_mpage_readpage+0x25b/0x390

Hmmm. looks like raid0_mergeable_bvec is simply wrong,
(in my defense, I re-wrote it before having seen the caller...)

Below is a patch that might fix it (key part is removing addition
of biovec->bv_len, rest is changing 'K' to more sensible 'sectors'.

Jens: It looks like the biovec arg to ->merge_bvec_fn is
un-necessary. Is that right or am I missing something?

NeilBrown

--- drivers/md/raid0.c 2002/11/09 00:04:57 1.1
+++ drivers/md/raid0.c 2002/11/09 00:06:46
@@ -174,14 +174,14 @@ static int raid0_mergeable_bvec(request_
 {
         mddev_t *mddev = q->queuedata;
         sector_t block;
- unsigned int chunk_size;
- unsigned int bio_sz;
+ unsigned int chunk_sectors;
+ unsigned int bio_sectors;
 
- chunk_size = mddev->chunk_size >> 10;
- block = bio->bi_sector >> 1;
- bio_sz = (bio->bi_size + biovec->bv_len) >> 10;
+ chunk_sectors = mddev->chunk_size >> 9;
+ sector = bio->bi_sector;
+ bio_sectors = bio->bi_size >> 9;
 
- return (chunk_size - ((block & (chunk_size - 1)) + bio_sz)) << 10;
+ return (chunk_sectors - ((sector & (chunk_sectors - 1)) + bio_sectors)) << 9;
 }
 
 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/



This archive was generated by hypermail 2b29 : Fri Nov 15 2002 - 22:00:16 EST