]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
IMSM: don't crash when creating an array with missing devices.
authorNeilBrown <neilb@suse.de>
Mon, 20 Jan 2014 22:40:02 +0000 (09:40 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 20 Jan 2014 22:40:02 +0000 (09:40 +1100)
'missing' devices are in a different list so when collection the
serial numbers of all devices we need to check both lists.

Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index c103ffdd2dd81e0aafdfb5031d30ad3e3fe4673a..f0a7ab5ccc7abe44e103de4b8b64edd5679f7d5a 100644 (file)
@@ -5210,6 +5210,8 @@ static int create_array(struct supertype *st, int dev_idx)
                int idx = get_imsm_disk_idx(dev, i, MAP_X);
 
                disk = get_imsm_disk(super, idx);
+               if (!disk)
+                       disk = get_imsm_missing(super, idx);
                serialcpy(inf[i].serial, disk->serial);
        }
        append_metadata_update(st, u, len);