linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
	ed.ciechanowski@intel.com
Subject: [PATCH 2/4] imsm: clean up missing disks if there are any left after migration
Date: Thu, 05 Apr 2012 17:30:21 +0200	[thread overview]
Message-ID: <20120405153021.19851.74528.stgit@linux.site> (raw)
In-Reply-To: <20120405152553.19851.48052.stgit@linux.site>

It is for compatibility with OROM way to set "recovery" state.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
---
 super-intel.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index e1cd9b8..f843997 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7211,6 +7211,8 @@ skip_mark_checkpoint:
 	return consistent;
 }
 
+static void imsm_delete(struct intel_super *super, struct dl **dlp, unsigned index);
+
 static void imsm_set_disk(struct active_array *a, int n, int state)
 {
 	int inst = a->info.container_member;
@@ -7260,6 +7262,11 @@ static void imsm_set_disk(struct active_array *a, int n, int state)
 			dprintf("while rebuilding");
 			end_migration(dev, super, map_state);
 			map = get_imsm_map(dev, MAP_0);
+			/* sweep list of missing disks, OROM might leave
+			 * some residuals from old members */
+			while (super->missing) {
+				imsm_delete(super, &super->missing, super->missing->index);
+			}
 			map->failed_disk_num = ~0;
 			super->updates_pending++;
 			a->last_checkpoint = 0;
@@ -7792,8 +7799,6 @@ static int remove_disk_super(struct intel_super *super, int major, int minor)
 	return 0;
 }
 
-static void imsm_delete(struct intel_super *super, struct dl **dlp, unsigned index);
-
 static int add_remove_disk_update(struct intel_super *super)
 {
 	int check_degraded = 0;


  parent reply	other threads:[~2012-04-05 15:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 15:28 [PATCH 0/4] Imsm OROM compatibility/boot support fixes Przemyslaw Czarnowski
2012-04-05 15:29 ` [PATCH 1/4] imsm: monitor: do not finish migration if there are no failed disks Przemyslaw Czarnowski
2012-04-05 17:56   ` Williams, Dan J
2012-04-05 15:30 ` Przemyslaw Czarnowski [this message]
2012-04-05 17:06   ` [PATCH 2/4] imsm: clean up missing disks if there are any left after migration Williams, Dan J
2012-04-05 15:30 ` [PATCH 3/4] imsm: avoid double change of serial number of missing device Przemyslaw Czarnowski
2012-04-05 17:41   ` Williams, Dan J
2012-04-05 15:31 ` [PATCH 4/4] imsm: monitor: do not finish recovery, when raid goes to read-only Przemyslaw Czarnowski
2012-04-05 17:37   ` Williams, Dan J
2012-04-09 23:22 ` [PATCH 0/4] Imsm OROM compatibility/boot support fixes 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=20120405153021.19851.74528.stgit@linux.site \
    --to=przemyslaw.hawrylewicz.czarnowski@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.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).