]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
file-posix: Handle EINTR in preallocation=full write
authorFam Zheng <famz@redhat.com>
Fri, 27 Jul 2018 06:53:14 +0000 (14:53 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 31 Jul 2018 16:54:59 +0000 (11:54 -0500)
Cc: qemu-stable@nongnu.org
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(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 <mdroth@linux.vnet.ibm.com>
block/file-posix.c

index 3794c0007aba5a405b146ca67c85507536b3069d..30642b6ca9b7ca874bf9d7716c4604d313c2d115 100644 (file)
@@ -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");