From: NeilBrown Date: Wed, 27 Jul 2011 06:11:48 +0000 (+1000) Subject: IMSM: set ->raid_disk correctly in getinfo_super_imsm_volume X-Git-Tag: mdadm-3.2.3~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=656b6b5a55adb1fd223d82478c333264af52877a;p=thirdparty%2Fmdadm.git IMSM: set ->raid_disk correctly in getinfo_super_imsm_volume The 'raid_disk' can be different to the 'number' and must be the position of the device in the array, not in the container. Normally these should not be different, but the test-suite creates a possibility so it should work. Signed-off-by: NeilBrown --- diff --git a/super-intel.c b/super-intel.c index b4540137..dcab5f9b 100644 --- a/super-intel.c +++ b/super-intel.c @@ -2268,7 +2268,8 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, info->disk.major = dl->major; info->disk.minor = dl->minor; info->disk.number = dl->index; - info->disk.raid_disk = dl->index; + info->disk.raid_disk = get_imsm_disk_slot(map_to_analyse, + dl->index); } info->data_offset = __le32_to_cpu(map_to_analyse->pba_of_lba0); @@ -4330,7 +4331,7 @@ static int add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, devname); return 1; } - set_imsm_ord_tbl_ent(map, dk->number, dl->index); + set_imsm_ord_tbl_ent(map, dk->raid_disk, dl->index); dl->disk.status = CONFIGURED_DISK; /* if we are creating the first raid device update the family number */