IMSM: fix wait_for_reshape_imsm

This was waiting on "reshape_position" which doesn't
get update events.
Before sysfs_wait was introduced, the code to wait didn't
wait at all, so it spun.
With sysfs_wait, it would wait forever.

Change to wait in sync_completed which does get events.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2013-07-11 09:48:25 +10:00
parent 3afaff930c
commit 85ca499c6b
1 changed files with 4 additions and 4 deletions

View File

@ -10125,7 +10125,7 @@ exit_imsm_reshape_super:
******************************************************************************/
int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
{
int fd = sysfs_get_fd(sra, NULL, "reshape_position");
int fd = sysfs_get_fd(sra, NULL, "sync_completed");
unsigned long long completed;
/* to_complete : new sync_max position */
unsigned long long to_complete = sra->reshape_progress;
@ -10144,10 +10144,10 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
return 0;
}
if (completed > to_complete) {
if (completed > position_to_set) {
dprintf("imsm: wait_for_reshape_imsm() "
"wrong next position to set %llu (%llu)\n",
to_complete, completed);
to_complete, position_to_set);
close(fd);
return -1;
}
@ -10174,7 +10174,7 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
close(fd);
return 1;
}
} while (completed < to_complete);
} while (completed < position_to_set);
close(fd);
return 0;