]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
IMSM: set ->raid_disk correctly in getinfo_super_imsm_volume
authorNeilBrown <neilb@suse.de>
Wed, 27 Jul 2011 06:11:48 +0000 (16:11 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 27 Jul 2011 06:11:48 +0000 (16:11 +1000)
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 <neilb@suse.de>
super-intel.c

index b4540137570402a8f1a27dec2936159ea6c8b60e..dcab5f9b2b490b394344d910e01fcff6a8354a9d 100644 (file)
@@ -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 */