]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: don't update migration record when reshape is interrupted
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Tue, 5 Jan 2016 16:16:16 +0000 (17:16 +0100)
committerNeilBrown <neilb@suse.com>
Thu, 7 Jan 2016 00:10:34 +0000 (11:10 +1100)
Abort imsm_manage_reshape() without updating the migration record if any
error occurs when checking progress. If reshape is interrupted and the
migration record is then updated, the checkpoint will be wrong and will
cause reshape to fail when the array is restarted.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
super-intel.c

index 3b3d561a0da21373a5e7ed12aa3748533728c342..90b7b6dee5d0ab4c2b01239667eaac44c61c237d 100644 (file)
@@ -10373,7 +10373,7 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
        if (sysfs_fd_get_ll(fd, &completed) < 0) {
                dprintf("cannot read reshape_position (no reshape in progres)\n");
                close(fd);
-               return 0;
+               return 1;
        }
 
        if (completed > position_to_set) {
@@ -10662,7 +10662,7 @@ static int imsm_manage_reshape(
                sra->reshape_progress = next_step;
 
                /* wait until reshape finish */
-               if (wait_for_reshape_imsm(sra, ndata) < 0) {
+               if (wait_for_reshape_imsm(sra, ndata)) {
                        dprintf("wait_for_reshape_imsm returned error!\n");
                        goto abort;
                }