summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-07-31 17:11:42 -0700
committerDan Williams <dan.j.williams@intel.com>2009-07-31 17:11:42 -0700
commit7e8545e954dbe0c08277bb8141057c4ae05fada3 (patch)
tree58c6b5b588b7f9c5a599ba1f754624367fc0618b /super-intel.c
parent969c255511a4bd12e6becc11b2a822f24c1fbb76 (diff)
downloadmdadm-7e8545e954dbe0c08277bb8141057c4ae05fada3.tar.gz
mdadm-7e8545e954dbe0c08277bb8141057c4ae05fada3.tar.xz
mdadm-7e8545e954dbe0c08277bb8141057c4ae05fada3.zip
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@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c6
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);