From: Fam Zheng Date: Fri, 27 Jul 2018 06:53:14 +0000 (+0800) Subject: file-posix: Handle EINTR in preallocation=full write X-Git-Tag: v2.12.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aae299a68ddb1945e571487b3de8f20e4366a225;p=thirdparty%2Fqemu.git file-posix: Handle EINTR in preallocation=full write Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf (cherry picked from commit a1c81f4f16a74d0d544f5d3ac405bcaad83541fd) Conflicts: block/file-posix.c * avoid dep on 93f4e2ff by adding check to raw_regular_truncate instead Signed-off-by: Michael Roth --- diff --git a/block/file-posix.c b/block/file-posix.c index 3794c0007ab..30642b6ca9b 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -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");