[PATCH 19/21] imsm: FIX: Remove timeout from wait_for_reshape_imsm()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Timeout should not be used for select function in wait_for_reshape_imsm().

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 8806339..fae1218 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -8574,8 +8574,6 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
 	unsigned long long to_complete = sra->reshape_progress;
 	unsigned long long position_to_set = to_complete / ndata;
 
-	struct timeval timeout;
-
 	if (fd < 0) {
 		dprintf("imsm: wait_for_reshape_imsm() "
 			"cannot open reshape_position\n");
@@ -8606,25 +8604,22 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
 		return -1;
 	}
 
-	/* FIXME should not need a timeout at all */
-	timeout.tv_sec = 30;
-	timeout.tv_usec = 0;
 	do {
 		char action[20];
 		fd_set rfds;
 		FD_ZERO(&rfds);
 		FD_SET(fd, &rfds);
-		select(fd+1, NULL, NULL, &rfds, &timeout);
+		select(fd+1, &rfds, NULL, NULL, NULL);
+		if (sysfs_get_str(sra, NULL, "sync_action",
+				  action, 20) > 0 &&
+				strncmp(action, "reshape", 7) != 0)
+			break;
 		if (sysfs_fd_get_ll(fd, &completed) < 0) {
 			dprintf("imsm: wait_for_reshape_imsm() "
 				"cannot read reshape_position (in loop)\n");
 			close(fd);
 			return 1;
 		}
-		if (sysfs_get_str(sra, NULL, "sync_action",
-				  action, 20) > 0 &&
-		    strncmp(action, "reshape", 7) != 0)
-			break;
 	} while (completed < to_complete);
 	close(fd);
 	return 0;

--
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


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux