linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] imsm: Update metadata for second array
@ 2011-01-28  8:21 Adam Kwolek
  2011-01-31  0:04 ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Kwolek @ 2011-01-28  8:21 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, dan.j.williams, ed.ciechanowski, wojciech.neubauer

When second array reshape is about to start external metadata should be updated
by mdmon in imsm_set_array_state().
for this purposes imsm_progress_container_reshape() is reused.

In imsm_progress_container_reshape() we have to make sure that prev_disks
shows expanded disks number. Current decision about prev_disks in 'for'
loop doesn't make us sure about this. We are getting first positive value,
but not necessarily right one.

prev_disks have to be found before we enter 'for' loop.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 super-intel.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index d5501bd..4ae4764 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5062,6 +5062,15 @@ static void imsm_progress_container_reshape(struct intel_super *super)
 	int prev_disks = -1;
 	int i;
 
+	/* find maximum number of disks used in any array
+	 */
+	for (i = 0; i < mpb->num_raid_devs; i++) {
+		struct imsm_dev *dev = get_imsm_dev(super, i);
+		struct imsm_map *map = get_imsm_map(dev, 0);
+		if (map->num_members > prev_disks)
+			prev_disks = map->num_members;
+	}
+
 	for (i = 0; i < mpb->num_raid_devs; i++) {
 		struct imsm_dev *dev = get_imsm_dev(super, i);
 		struct imsm_map *map = get_imsm_map(dev, 0);
@@ -5253,13 +5262,17 @@ static int imsm_set_array_state(struct active_array *a, int consistent)
 		super->updates_pending++;
 	}
 
-	/* finalize online capacity expansion/reshape */
+	/* manage online capacity expansion/reshape */
 	if ((a->curr_action != reshape) &&
 	    (a->prev_action == reshape)) {
 		struct mdinfo *mdi;
 
+		/* finalize online capacity expansion/reshape */
 		for (mdi = a->info.devs; mdi; mdi = mdi->next)
 			imsm_set_disk(a, mdi->disk.raid_disk, mdi->curr_state);
+
+		/* check next volume reshape */
+		imsm_progress_container_reshape(super);
 	}
 
 	return consistent;


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-31  8:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28  8:21 [PATCH] imsm: Update metadata for second array Adam Kwolek
2011-01-31  0:04 ` NeilBrown
2011-01-31  7:43   ` Kwolek, Adam
2011-01-31  8:29     ` NeilBrown
2011-01-31  8:48       ` Kwolek, Adam

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).