Skip to content
Snippets Groups Projects
Commit aae299a6 authored by Fam Zheng's avatar Fam Zheng Committed by Michael Roth
Browse files

file-posix: Handle EINTR in preallocation=full write


Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarFam Zheng <famz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
(cherry picked from commit a1c81f4f)
 Conflicts:
	block/file-posix.c
* avoid dep on 93f4e2ff by adding check to raw_regular_truncate instead
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent b102aea5
Branches
No related tags found
No related merge requests found
...@@ -1728,6 +1728,9 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc, ...@@ -1728,6 +1728,9 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
num = MIN(left, 65536); num = MIN(left, 65536);
result = write(fd, buf, num); result = write(fd, buf, num);
if (result < 0) { if (result < 0) {
if (errno == EINTR) {
continue;
}
result = -errno; result = -errno;
error_setg_errno(errp, -result, error_setg_errno(errp, -result,
"Could not write zeros for preallocation"); "Could not write zeros for preallocation");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment