linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Mike Accetta <maccetta@laurelnetworks.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: raid1 check/repair read error recovery in 2.6.20
Date: Fri, 1 Jun 2007 10:18:52 +1000	[thread overview]
Message-ID: <18015.26092.718913.90023@notabene.brown> (raw)
In-Reply-To: message from Mike Accetta on Thursday May 24

On Thursday May 24, maccetta@laurelnetworks.com wrote:
> I believe I've come across a bug in the disk read error recovery logic
> for raid1 check/repair operations in 2.6.20.  The raid1.c file looks
> identical in 2.6.21 so the problem should still exist there as well.

Yes, you have found a bug, thanks.

> 
> I tried the following patch to raid1.c which short-ciruits the data
> comparison in the read error case but otherwise does the rest of the
> sbio prep for the mirror with the error.  It seems to have eliminated
> the ATA warning at least.  Is it a correct thing to do?

Yes, that is the correct thing to do.  I'll get this (with maybe some
small cosmetic changes) upstream.

Thanks again,
NeilBrown

> 
> @@ -1235,17 +1242,20 @@
>  			}
>  		r1_bio->read_disk = primary;
>  		for (i=0; i<mddev->raid_disks; i++)
> -			if (r1_bio->bios[i]->bi_end_io == end_sync_read &&
> -			    test_bit(BIO_UPTODATE, &r1_bio->bios[i]->bi_flags)) {
> +			if (r1_bio->bios[i]->bi_end_io == end_sync_read) {
>  				int j;
>  				int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9);
>  				struct bio *pbio = r1_bio->bios[primary];
>  				struct bio *sbio = r1_bio->bios[i];
> -				for (j = vcnt; j-- ; )
> -					if (memcmp(page_address(pbio->bi_io_vec[j].bv_page),
> -						   page_address(sbio->bi_io_vec[j].bv_page),
> -						   PAGE_SIZE))
> -						break;
> +				if (test_bit(BIO_UPTODATE, &sbio->bi_flags)) {
> +					for (j = vcnt; j-- ; )
> +						if (memcmp(page_address(pbio->bi_io_vec[j].bv_page),
> +							   page_address(sbio->bi_io_vec[j].bv_page),
> +							   PAGE_SIZE))
> +							break;
> +				} else {
> +					j = 0;
> +				}
>  				if (j >= 0)
>  					mddev->resync_mismatches += r1_bio->sectors;
>  				if (j < 0 || test_bit(MD_RECOVERY_CHECK, &mddev->recovery)) {

      reply	other threads:[~2007-06-01  0:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-25  3:27 raid1 check/repair read error recovery in 2.6.20 Mike Accetta
2007-06-01  0:18 ` Neil Brown [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=18015.26092.718913.90023@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=maccetta@laurelnetworks.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;
as well as URLs for NNTP newsgroup(s).