]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-intel.c
imsm: abort reshape if sync_action is not "reshape"
[thirdparty/mdadm.git] / super-intel.c
index e609e0ca3a2dae9f80245cca78f8765ffebcc482..c7efa98f9bdbc446361b0ee534ec65c54163da49 100644 (file)
@@ -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);