linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Paradis <jparadis@redhat.com>
To: NeilBrown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH/RFC] Fix resync hang after surprise removal
Date: Fri, 17 Jun 2011 11:42:19 -0400 (EDT)	[thread overview]
Message-ID: <4770908.772445.1308325339109.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> (raw)
In-Reply-To: <20110616113656.190fef9f@notabene.brown>


> NeilBrown <neilb@suse.de> wrote:
> Hi,
> thanks for the report and the patch.
> 
> However I don't think the patch really does what you want.
> 
> The two tests are already mutually exclusive as one begins with
> raid_disk >= 0
> and the other with
> raid_disk < 0
> and neither change raid_disk.
> 
> The reason the patch has an effect is the 'break' that has been added.
> i.e. as soon as you find a normal working device you break out of the
> loop
> and stop looking for spares.
> 
> I think the correct fix is simply:
> 
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 4332fc2..91e31e2 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -7088,6 +7088,7 @@ static int remove_and_add_spares(mddev_t *mddev)
> list_for_each_entry(rdev, &mddev->disks, same_set) {
> if (rdev->raid_disk >= 0 &&
> !test_bit(In_sync, &rdev->flags) &&
> + !test_bit(Faulty, &rdev->flags) &&
> !test_bit(Blocked, &rdev->flags))
> spares++;
> if (rdev->raid_disk < 0
> 
> 
> i.e. never consider a Faulty device to be a spare.
> 
> It looks like this bug was introduced by commit dfc70645000616777
> in 2.6.26 when we allowed partially recovered devices to remain in the
> array
> when a different device fails.
> 
> Can you please conform that this patch removes your symptom?
> 
> Thanks,
> NeilBrown

This patch does indeed fix the problem!  Thanks!

--jim


      reply	other threads:[~2011-06-17 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 16:02 [PATCH/RFC] Fix resync hang after surprise removal Jim Paradis
2011-06-16  1:36 ` NeilBrown
2011-06-17 15:42   ` James Paradis [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=4770908.772445.1308325339109.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com \
    --to=jparadis@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).