]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Handle edge case with suspend_point updates.
authorNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 23:51:44 +0000 (10:51 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 11 Jan 2011 23:51:44 +0000 (10:51 +1100)
If reshape_progress equals suspend_point, it is also appropriate to
update the end of the suspend region.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 9816ff24aa743b35bd18afc39c79bb2318806e1a..0bec605a8e8db08a727da633b7cdca0defcb8767 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2293,14 +2293,14 @@ int progress_reshape(struct mdinfo *info, struct reshape *reshape,
         * native metadata when we don't need to back-up.
         */
        if (advancing) {
-               if (info->reshape_progress < *suspend_point)
+               if (info->reshape_progress <= *suspend_point)
                        sysfs_set_num(info, NULL, "suspend_lo",
                                      info->reshape_progress);
        } else {
                /* Note: this won't work in 2.6.37 and before.
                 * Something somewhere should make sure we don't need it!
                 */
-               if (info->reshape_progress > *suspend_point)
+               if (info->reshape_progress >= *suspend_point)
                        sysfs_set_num(info, NULL, "suspend_hi",
                                      info->reshape_progress);
        }