]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm:FIX: change arrays reshape order
authorAdam Kwolek <adam.kwolek@intel.com>
Mon, 31 Jan 2011 08:59:22 +0000 (09:59 +0100)
committerNeilBrown <neilb@suse.de>
Mon, 31 Jan 2011 23:17:06 +0000 (10:17 +1100)
Reshape is started from second array, so it causes imsm incompatibility
and problems during second array start.

Reshape should be started in arrays metadata order.

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

index f578057d9842b297572bacd6ab11c8ef6cfc4cdc..8484df65be9517c8bb5268182961e10d785eb468 100644 (file)
@@ -5848,6 +5848,7 @@ static int apply_reshape_container_disks_update(struct imsm_update_reshape *u,
        int devices_to_reshape = 1;
        struct imsm_super *mpb = super->anchor;
        int ret_val = 0;
+       unsigned int dev_id;
 
        dprintf("imsm: imsm_process_update() for update_reshape\n");
 
@@ -5877,11 +5878,17 @@ static int apply_reshape_container_disks_update(struct imsm_update_reshape *u,
                " mpb->num_raid_devs = %i\n", mpb->num_raid_devs);
        /* manage changes in volume
         */
-       for (id = super->devlist ; id; id = id->next) {
+       for (dev_id = 0; dev_id < mpb->num_raid_devs; dev_id++) {
                void **sp = *space_list;
                struct imsm_dev *newdev;
                struct imsm_map *newmap, *oldmap;
 
+               for (id = super->devlist ; id; id = id->next) {
+                       if (id->index == dev_id)
+                               break;
+               }
+               if (id == NULL)
+                       break;
                if (!sp)
                        continue;
                *space_list = *sp;