]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
FIX: Last_checkpoint has to be initialized in per disk units
authorAdam Kwolek <adam.kwolek@intel.com>
Mon, 14 Mar 2011 07:17:52 +0000 (18:17 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 14 Mar 2011 07:17:52 +0000 (18:17 +1100)
last_checkpoint is variable that tracks sync_complete sysfs entry.
sync_complete is per disk counter, so initializing during starting from checkpoint
has to have this in mind and convert reshape position properly.

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

index 1362a0e9689e3397de139e0e9ab844fa18193a1e..19e5f4179075b0043a774807e350ef7cf8a443f2 100644 (file)
@@ -667,6 +667,15 @@ static void manage_new(struct mdstat_ent *mdstat,
                if (sysfs_get_ll(mdi, NULL, "reshape_position",
                        &new->last_checkpoint) != 0)
                        new->last_checkpoint = 0;
+               else {
+                       int data_disks = mdi->array.raid_disks;
+                       if (mdi->array.level == 4 || mdi->array.level == 5)
+                               data_disks--;
+                       if (mdi->array.level == 6)
+                               data_disks -= 2;
+
+                       new->last_checkpoint /= data_disks;
+               }
                dprintf("mdmon: New monitored array is under reshape.\n"
                        "       Last checkpoint is: %llu\n",
                        new->last_checkpoint);