Sometimes wait_backup() omits transition from reshape to iddle state and mdadm seams to be hung. Add 1 sec. timeout wor waiting on select. This allows for wait_backup exit when reshape is ended. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- Grow.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/Grow.c b/Grow.c index 24c5c39..e16b1ad 100644 --- a/Grow.c +++ b/Grow.c @@ -2074,10 +2074,14 @@ static int wait_backup(struct mdinfo *sra, sysfs_set_str(sra, NULL, "sync_action", "reshape"); do { char action[20]; + struct timeval t; + + t.tv_sec = 1; + t.tv_usec = 0; fd_set rfds; FD_ZERO(&rfds); FD_SET(fd, &rfds); - select(fd+1, NULL, NULL, &rfds, NULL); + select(fd+1, NULL, NULL, &rfds, &t); if (sysfs_fd_get_ll(fd, &completed) < 0) { close(fd); return -1; -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html