Re: [PATCH 13/17] Monitor: autorebuild functionality added

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/29/2010 7:25 AM, Czarnowska, Anna wrote:
 From 43c50f74689943e85913db343b33a0ff24812721 Mon Sep 17 00:00:00 2001
From: Anna Czarnowska<anna.czarnowska@xxxxxxxxx>
Date: Thu, 28 Oct 2010 13:20:21 +0200
Subject: [PATCH 13/17] Monitor: autorebuild functionality added

After all information on arrays is updated we first move spares
using spare-group information from config file, then link containers with
subarrays and call spare_sharing. Arrays with defined spare-groups
are not considered again. spare_sharing searches for suitable spares
in other arrays and moves them using move_spare to the arrays
that need them. move_spare removes spare from one array/container
and adds to another. If add fails we add back to original container.
Manage_subdevs function is used to perform the spare relocation.

Signed-off-by: Anna Czarnowska<anna.czarnowska@xxxxxxxxx>
Signed-off-by: Marcin Labun<marcin.labun@xxxxxxxxx>
---
  Monitor.c |  299 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
  1 files changed, 294 insertions(+), 5 deletions(-)

Looks good, only a couple of future enhancements.

A ddf array may be able to fix up a degraded array with free space on another array member. So we may need to ensure that mdmon has had a chance to perform the search before we grab a free spare from another container.

+static struct supertype *get_super(struct state *st)
+{
+	struct supertype *super = NULL;
+	char *metadata = NULL;
+	int i;
+
+	if (is_external(st->metadata_version)) {
+		st = st->parent;
+		if (!st)
+			return NULL;
+		metadata = st->metadata_version + strlen("external:");
+	} else {
+		metadata = st->metadata_version;
+	}
+	for (i = 0; !super&&  superlist[i]; i++)
+		super = superlist[i]->match_metadata_desc(metadata);

This looks like an open-coded version_to_superswitch()
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux