diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2015-12-23 12:57:11 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-12-24 10:04:24 +1100 |
commit | d7d3809a1b93f9f7b7ca7d874c17632cb3305c76 (patch) | |
tree | 61c864d4c03de1371e9c2c5a97576af85e4edafb | |
parent | 10df72a080f71f01553a14ed8112cee6af7912e8 (diff) | |
download | mdadm-d7d3809a1b93f9f7b7ca7d874c17632cb3305c76.tar.gz |
imsm: abort reshape if sync_action is not "reshape"
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>
-rw-r--r-- | super-intel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/super-intel.c b/super-intel.c index e609e0c..c7efa98 100644 --- a/super-intel.c +++ b/super-intel.c @@ -10300,8 +10300,10 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) 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); |