From: Dan Williams Date: Sat, 1 Aug 2009 00:11:42 +0000 (-0700) Subject: imsm: fix spare-uuid assignment X-Git-Tag: mdadm-3.0.1~6^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e8545e954dbe0c08277bb8141057c4ae05fada3;p=thirdparty%2Fmdadm.git 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 --- diff --git a/super-intel.c b/super-intel.c index 6e4a7d90..dc0c9c06 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);