]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: Optimize expansion speed when no backup is required
authorAdam Kwolek <adam.kwolek@intel.com>
Thu, 9 Jun 2011 03:00:56 +0000 (13:00 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 9 Jun 2011 03:00:56 +0000 (13:00 +1000)
When no reshape backup is required (e.g. OLCE after critical section),
check-pointing can use bigger steps than backup space allows for.

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

index 292584b163950a2edf5e9408afb94b4bdd34edd9..5c840ec3a569519463a125a3ebac4ed33fbfc91c 100644 (file)
@@ -8854,11 +8854,19 @@ static int imsm_manage_reshape(
                                        "migration record (UNIT_SRC_IN_CP_AREA)\n");
                                goto abort;
                        }
+               } else {
+                       /* set next step to use whole border area */
+                       border /= next_step;
+                       if (border > 1)
+                               next_step *= border;
                }
                /* When data backed up, checkpoint stored,
                 * kick the kernel to reshape unit of data
                 */
                next_step = next_step + sra->reshape_progress;
+               /* limit next step to array max position */
+               if (next_step > max_position)
+                       next_step = max_position;
                sysfs_set_num(sra, NULL, "suspend_lo", sra->reshape_progress);
                sysfs_set_num(sra, NULL, "suspend_hi", next_step);
                sra->reshape_progress = next_step;