From aae299a68ddb1945e571487b3de8f20e4366a225 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 27 Jul 2018 14:53:14 +0800 Subject: [PATCH] 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 --- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 3794c0007a..30642b6ca9 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"); -- 2.50.1