]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: FIX: Report correct array size during reshape
authorAdam Kwolek <adam.kwolek@intel.com>
Tue, 22 Feb 2011 14:13:31 +0000 (15:13 +0100)
committerNeilBrown <neilb@suse.de>
Wed, 23 Feb 2011 03:16:37 +0000 (14:16 +1100)
When reshape is started imsm stores new size in metadata.
mdadm requires "old" size to proper initialization restarted array.

When reshape is in progress getinfo_super_imsm_volume() should report
computed array size value instead array size stored in metatda.

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

index 1b3407ae1e06ea4b9099346f92cbd03155fd395a..c101dca744a776c50677c0eada566eb5c2b52639 100644 (file)
@@ -1806,6 +1806,19 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
                        dprintf("IMSM: General Migration checkpoint : %llu "
                               "(%llu) -> read reshape progress : %llu\n",
                                units, blocks_per_unit, info->reshape_progress);
+                       unsigned long long array_blocks;
+                       int used_disks;
+
+                       used_disks = imsm_num_data_members(dev, 1);
+                       if (used_disks > 0) {
+                               array_blocks = map->blocks_per_member *
+                                       used_disks;
+                               /* round array size down to closest MB
+                                */
+                               info->custom_array_size = (array_blocks
+                                               >> SECT_PER_MB_SHIFT)
+                                               << SECT_PER_MB_SHIFT;
+                       }
                }
                case MIGR_VERIFY:
                        /* we could emulate the checkpointing of