linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mwilck@arcor.de
To: neilb@suse.de, linux-raid@vger.kernel.org
Cc: mwilck@arcor.de
Subject: [PATCH 3/4] DDF: ddf_activate_spare: only activate good drives
Date: Thu, 25 Jul 2013 20:59:12 +0200	[thread overview]
Message-ID: <1374778753-6252-4-git-send-email-mwilck@arcor.de> (raw)
In-Reply-To: <1374778753-6252-1-git-send-email-mwilck@arcor.de>

Do not try to activate drives marked missing or failed.
---
 super-ddf.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/super-ddf.c b/super-ddf.c
index 13a2e61..ae1222c 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -4773,6 +4773,13 @@ static struct mdinfo *ddf_activate_spare(struct active_array *a,
 	/* For each slot, if it is not working, find a spare */
 	dl = ddf->dlist;
 	for (i = 0; i < a->info.array.raid_disks; i++) {
+		be16 state = ddf->phys->entries[dl->pdnum].state;
+		if (be16_and(state,
+			     cpu_to_be16(DDF_Failed|DDF_Missing)) ||
+		    !be16_and(state,
+			      cpu_to_be16(DDF_Online)))
+			continue;
+
 		for (d = a->info.devs ; d ; d = d->next)
 			if (d->disk.raid_disk == i)
 				break;
-- 
1.7.1

  parent reply	other threads:[~2013-07-25 18:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 18:59 [PATCH 0/4] Basic hotspare handling for RAID10 mwilck
2013-07-25 18:59 ` [PATCH 1/4] DDF: find_vdcr: fix minor bug in debug message mwilck
2013-07-25 18:59 ` [PATCH 2/4] DDF: ddf_activate_spare: Add RAID10 code mwilck
2013-07-25 18:59 ` mwilck [this message]
2013-07-25 18:59 ` [PATCH 4/4] DDF: ddf_activate_spare: fix metadata update for SVDs mwilck
2013-07-30  1:22 ` [PATCH 0/4] Basic hotspare handling for RAID10 NeilBrown

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=1374778753-6252-4-git-send-email-mwilck@arcor.de \
    --to=mwilck@arcor.de \
    --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).