Dan Williams: imsm: fix spare-uuid assignment

Martin F. Krafft madduck at alioth.debian.org
Tue Oct 27 19:45:17 UTC 2009


Module: mdadm
Branch: build
Commit: 7e8545e954dbe0c08277bb8141057c4ae05fada3
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=7e8545e954dbe0c08277bb8141057c4ae05fada3

Author: Dan Williams <dan.j.williams at intel.com>
Date:   Fri Jul 31 17:11:42 2009 -0700

imsm: fix spare-uuid assignment

imsm spares do not have container membership by default so we associate
them with the first container found in the configuration file.  Some
ARRAY lines do not specify the metadata type so we cannot assume that
_cst will always be valid.

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


---

 super-intel.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 6e4a7d9..dc0c9c0 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -1268,7 +1268,11 @@ static void fixup_container_spare_uuid(struct mdinfo *inf)
 			struct supertype *_cst; /* container supertype */
 
 			_cst = array_list->st;
-			_sst = _cst->ss->match_metadata_desc(inf->text_version);
+			if (_cst)
+				_sst = _cst->ss->match_metadata_desc(inf->text_version);
+			else
+				_sst = NULL;
+
 			if (_sst) {
 				memcpy(inf->uuid, array_list->uuid, sizeof(int[4]));
 				free(_sst);




More information about the pkg-mdadm-commits mailing list