file-posix: Handle EINTR in preallocation=full write
Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commitstable-2.12a1c81f4f16
) Conflicts: block/file-posix.c * avoid dep on93f4e2ff
by adding check to raw_regular_truncate instead Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
parent
b102aea574
commit
aae299a68d
|
@ -1728,6 +1728,9 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
|
|||
num = MIN(left, 65536);
|
||||
result = write(fd, buf, num);
|
||||
if (result < 0) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
result = -errno;
|
||||
error_setg_errno(errp, -result,
|
||||
"Could not write zeros for preallocation");
|
||||
|
|
Loading…
Reference in New Issue