From: NeilBrown Date: Mon, 20 Jan 2014 22:40:02 +0000 (+1100) Subject: IMSM: don't crash when creating an array with missing devices. X-Git-Tag: mdadm-3.3.1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ca5c8e0c74946f4fcd74e97c5f48fba482d9596;p=thirdparty%2Fmdadm.git IMSM: don't crash when creating an array with missing devices. '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 --- diff --git a/super-intel.c b/super-intel.c index c103ffdd..f0a7ab5c 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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);