Linus, 
 I sent this patch to Alan a little while ago, but after ac4, so I
 don't know if it went into his tree.

 There is a bit of code at the front of raid5_sync_request which
 calculates which block is the parity block for a given stripe.
 However, to convert from a block number (1K units) to a sector number
 it does <<2 instead of <<1 or *2, which leads to the wrong results.
 This can lead to data corruption, hanging, or an Oops.

 This patch fixes it (and allows my raid5 testing to run happily to
 completion). 

NeilBrown


--- ./drivers/md/raid5.c        2000/11/29 04:15:54     1.1
+++ ./drivers/md/raid5.c        2000/11/29 04:16:29     1.2
@@ -1516,8 +1516,8 @@
        raid5_conf_t *conf = (raid5_conf_t *) mddev->private;
        struct stripe_head *sh;
        int sectors_per_chunk = conf->chunk_size >> 9;
-       unsigned long stripe = (block_nr<<2)/sectors_per_chunk;
-       int chunk_offset = (block_nr<<2) % sectors_per_chunk;
+       unsigned long stripe = (block_nr<<1)/sectors_per_chunk;
+       int chunk_offset = (block_nr<<1) % sectors_per_chunk;
        int dd_idx, pd_idx;
        unsigned long first_sector;
        int raid_disks = conf->raid_disks;
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]

Reply via email to