When reshape was interrupted, an incorrect checkpoint would be saved in
the migration record. Change wait_for_reshape_imsm() to return -1 when
sync_action is not "reshape" to abort early in imsm_manage_reshape()
without writing the migration record.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
sysfs_wait(fd, NULL);
if (sysfs_get_str(sra, NULL, "sync_action",
action, 20) > 0 &&
- strncmp(action, "reshape", 7) != 0)
- break;
+ strncmp(action, "reshape", 7) != 0) {
+ close(fd);
+ return -1;
+ }
if (sysfs_fd_get_ll(fd, &completed) < 0) {
dprintf("cannot read reshape_position (in loop)\n");
close(fd);