On Mon, 2004-09-20 at 18:14, Martin Josefsson wrote: Hi Paul > > I've been debugging the same problem just recently. In addition to this > > patch from Neil, you'll also need a patch that I posted here last week, > > which does a bio_put() and a bio_clone() to get rid of the old bio that > > the read error occurred on, and create a new (clean) bio to retry the > > read against: > > > > http://marc.theaimsgroup.com/?l=linux-raid&m=109527014728404&w=2 > > Thanks, will try it out tomorrow when I'm back in front of the machine. > Didn't expect an answer so soon :) I tested the patch today, worked like a charm. Thank you. There's been some small changes in 2.6.9-rc2-bk6 which is the kernel I've been testing with. I applied your fix by hand and diffed, the resulting patch is attached to make life easy for others with the same problem. Thanks again. -- /Martin
--- linux-2.6.9-rc2-bk6/drivers/md/raid1.c.nofix 2004-09-21 09:25:48.000000000 +0200 +++ linux-2.6.9-rc2-bk6/drivers/md/raid1.c 2004-09-21 09:27:56.000000000 +0200 @@ -941,6 +941,9 @@ } else { r1_bio->bios[r1_bio->read_disk] = NULL; r1_bio->read_disk = disk; + /* discard the failed bio and clone a new one */ + bio_put(bio); + bio = bio_clone(r1_bio->master_bio, GFP_NOIO); r1_bio->bios[r1_bio->read_disk] = bio; rdev = conf->mirrors[disk].rdev; if (printk_ratelimit()) @@ -948,9 +951,11 @@ " another mirror\n", bdevname(rdev->bdev,b), (unsigned long long)r1_bio->sector); - bio->bi_bdev = rdev->bdev; bio->bi_sector = r1_bio->sector + rdev->data_offset; + bio->bi_bdev = rdev->bdev; + bio->bi_end_io = raid1_end_read_request; bio->bi_rw = READ; + bio->bi_private = r1_bio; unplug = 1; generic_make_request(bio); }
Attachment:
signature.asc
Description: This is a digitally signed message part