All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maurilio Longo <maurilio.longo@libero.it>
To: linux raid mailing list <linux-raid@vger.kernel.org>
Cc: NeilBrown <neilb@cse.unsw.edu.au>
Subject: Re: [PATCH md ] Fix up handling for read error in raid1.
Date: Mon, 12 Jul 2004 16:29:41 +0200	[thread overview]
Message-ID: <40F2A055.93DD9C4B@libero.it> (raw)
In-Reply-To: E1BdLyz-0001Jy-Tq@notabene.cse.unsw.edu.au

Neil,

do you have a similar patch for a 2.4.x (x == 20 in my case) kernel?

I can't change kernel easily since I use it to run mars-nwe which is a novell emulator
which is going to be removed from every distro I'm aware of :(

regards.


NeilBrown ha scritto:

> There is severe bit-rot in this code, which is to say that it doesn't work
> at all: an io error during read will do bad things.  It should work
> better with this patch.
>
> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
>
> ### Diffstat output
>  ./drivers/md/raid1.c |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff ./drivers/md/raid1.c~current~ ./drivers/md/raid1.c
> --- ./drivers/md/raid1.c~current~       2004-06-23 14:37:05.000000000 +1000
> +++ ./drivers/md/raid1.c        2004-06-23 14:37:13.000000000 +1000
> @@ -206,7 +206,7 @@ static int map(mddev_t *mddev, mdk_rdev_
>                         *rdevp = rdev;
>                         atomic_inc(&rdev->nr_pending);
>                         spin_unlock_irq(&conf->device_lock);
> -                       return 0;
> +                       return i;
>                 }
>         }
>         spin_unlock_irq(&conf->device_lock);
> @@ -945,18 +945,22 @@ static void raid1d(mddev_t *mddev)
>
>                 mddev = r1_bio->mddev;
>                 conf = mddev_to_conf(mddev);
> -               bio = r1_bio->master_bio;
>                 if (test_bit(R1BIO_IsSync, &r1_bio->state)) {
>                         sync_request_write(mddev, r1_bio);
>                         unplug = 1;
>                 } else {
> -                       if (map(mddev, &rdev) == -1) {
> +                       int disk;
> +                       bio = r1_bio->bios[r1_bio->read_disk];
> +                       if ((disk=map(mddev, &rdev)) == -1) {
>                                 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
>                                        " read error for block %llu\n",
>                                        bdevname(bio->bi_bdev,b),
>                                        (unsigned long long)r1_bio->sector);
>                                 raid_end_bio_io(r1_bio);
>                         } else {
> +                               r1_bio->bios[r1_bio->read_disk] = NULL;
> +                               r1_bio->read_disk = disk;
> +                               r1_bio->bios[r1_bio->read_disk] = bio;
>                                 printk(KERN_ERR "raid1: %s: redirecting sector %llu to"
>                                        " another mirror\n",
>                                        bdevname(rdev->bdev,b),
> -
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
 __________
|  |  | |__| md2520@mclink.it
|_|_|_|____|



  reply	other threads:[~2004-07-12 14:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040624143619.5067.patches@notabene>
2004-06-24  4:37 ` [PATCH md ] Fix up handling for read error in raid1 NeilBrown
2004-07-12 14:29   ` Maurilio Longo [this message]
2004-07-23  2:56     ` Neil Brown
2004-07-23  7:26       ` Maurilio Longo

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=40F2A055.93DD9C4B@libero.it \
    --to=maurilio.longo@libero.it \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.