Dan Williams: imsm: defend against unsupported migrations (temporary)

Martin F. Krafft madduck at alioth.debian.org
Thu May 7 12:11:40 UTC 2009


Module: mdadm
Branch: debian/experimental
Commit: 1ce0101c9a16ab5ffa148a0b8f5c9ac0d7b81684
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=1ce0101c9a16ab5ffa148a0b8f5c9ac0d7b81684

Author: Dan Williams <dan.j.williams at intel.com>
Date:   Sun Apr 12 00:58:28 2009 -0700

imsm: defend against unsupported migrations (temporary)

Until support for higher order migrations (online capacity expansion,
raid level migration, chunk size migration...) are implemented do not
allow arrays in these states to be assembled.

Signed-off-by: Dan Williams <dan.j.williams at intel.com>




---

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

diff --git a/super-intel.c b/super-intel.c
index 266d734..41e9168 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3355,6 +3355,18 @@ static struct mdinfo *container_content_imsm(struct supertype *st)
 		struct mdinfo *this;
 		int slot;
 
+		/* do not publish arrays that are in the middle of an
+		 * unsupported migration
+		 */
+		if (dev->vol.migr_state &&
+		    (migr_type(dev) == MIGR_GEN_MIGR ||
+		     migr_type(dev) == MIGR_STATE_CHANGE)) {
+			fprintf(stderr, Name ": cannot assemble volume '%.16s':"
+				" unsupported migration in progress\n",
+				dev->volume);
+			continue;
+		}
+
 		this = malloc(sizeof(*this));
 		memset(this, 0, sizeof(*this));
 		this->next = rest;
@@ -3401,7 +3413,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st)
 			info_d = malloc(sizeof(*info_d));
 			if (!info_d) {
 				fprintf(stderr, Name ": failed to allocate disk"
-					" for volume %s\n", (char *) dev->volume);
+					" for volume %.16s\n", dev->volume);
 				free(this);
 				this = rest;
 				break;




More information about the pkg-mdadm-commits mailing list