mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
tools/hv: terminate fcopy daemon if read from uio fails
Terminate endless loop in reading fails, to avoid flooding syslog. This happens if the state of "Guest services" integration service is changed from "enabled" to "disabled" at runtime in the VM settings. In this case pread returns EIO. Also handle an interrupted system call, and continue in this case. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com> Link: https://lore.kernel.org/r/20241105081437.15689-1-olaf@aepfle.de Signed-off-by: Wei Liu <wei.liu@kernel.org> Message-ID: <20241105081437.15689-1-olaf@aepfle.de>
This commit is contained in:
parent
67b5e1042d
commit
a9640fcdd4
@ -466,8 +466,10 @@ int main(int argc, char *argv[])
|
||||
*/
|
||||
ret = pread(fcopy_fd, &tmp, sizeof(int), 0);
|
||||
if (ret < 0) {
|
||||
if (errno == EINTR || errno == EAGAIN)
|
||||
continue;
|
||||
syslog(LOG_ERR, "pread failed: %s", strerror(errno));
|
||||
continue;
|
||||
goto close;
|
||||
}
|
||||
|
||||
len = HV_RING_SIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user