Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Martin Josefsson <gandalf@wlug.westbo.se>
To: Paul Clements <paul.clements@steeleye.com>
Cc: neilb@cse.unsw.edu.au, linux-raid@vger.kernel.org
Subject: Re: Problem with raid1 read error patch
Date: Tue, 21 Sep 2004 18:07:58 +0200	[thread overview]
Message-ID: <1095782878.8380.60.camel@tux.rsn.bth.se> (raw)
In-Reply-To: <1095696866.8380.23.camel@tux.rsn.bth.se>


[-- Attachment #1.1: Type: text/plain, Size: 905 bytes --]

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

[-- Attachment #1.2: raid1-errorfix.patch-2.6.9-rc2-bk6 --]
[-- Type: text/plain, Size: 954 bytes --]

--- 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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2004-09-21 16:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20 15:16 Problem with raid1 read error patch Martin Josefsson
2004-09-20 15:28 ` Paul Clements
2004-09-20 16:14   ` Martin Josefsson
2004-09-21 16:07     ` Martin Josefsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1095782878.8380.60.camel@tux.rsn.bth.se \
    --to=gandalf@wlug.westbo.se \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=paul.clements@steeleye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox