]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: fix spare-uuid assignment
authorDan Williams <dan.j.williams@intel.com>
Sat, 1 Aug 2009 00:11:42 +0000 (17:11 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 1 Aug 2009 00:11:42 +0000 (17:11 -0700)
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>
super-intel.c

index 6e4a7d90d8e9676a7ba329790768af37922d4ccd..dc0c9c06eca706d472bc0d42b4dde538af5e1ff2 100644 (file)
@@ -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);