]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: set correct slot information in metadata (raid0)
authorAdam Kwolek <adam.kwolek@intel.com>
Tue, 11 Jan 2011 14:03:55 +0000 (15:03 +0100)
committerNeilBrown <neilb@suse.de>
Wed, 12 Jan 2011 05:40:42 +0000 (16:40 +1100)
Slot was set based on anchor information.
Disks information was copied outside disk list area.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index ab6a2d5118d5ad40431cfde4ca070a815143b032..5e048b356a6c0e98b7ab28873b9fdac8ccae09b3 100644 (file)
@@ -5648,6 +5648,7 @@ static int apply_reshape_container_disks_update(struct imsm_update_reshape *u,
        struct intel_dev *id;
        int i;
        int delta_disks = u->new_raid_disks - u->old_raid_disks;
+       int disk_count = u->old_raid_disks;
        void **tofree = NULL;
        int devices_to_reshape = 1;
        struct imsm_super *mpb = super->anchor;
@@ -5668,7 +5669,7 @@ static int apply_reshape_container_disks_update(struct imsm_update_reshape *u,
                    ((new_disk->index >= 0) &&
                     (new_disk->index < u->old_raid_disks)))
                        goto update_reshape_exit;
-               new_disk->index = mpb->num_disks++;
+               new_disk->index = disk_count++;
                /* slot to fill in autolayout
                 */
                new_disk->raiddisk = new_disk->index;
@@ -6484,7 +6485,8 @@ static int imsm_create_metadata_update_for_reshape(
                u->new_disks[i] = makedev(dev->disk.major,
                                          dev->disk.minor);
                dl = get_disk_super(super, dev->disk.major, dev->disk.minor);
-               dl->index = mpb->num_disks++;
+               dl->index = mpb->num_disks;
+               mpb->num_disks++;
        }
        /* Now update the metadata so that container_content will find
         * the new devices