[Qemu-devel] [PULL 03/13] file-posix: Handle EINTR in preallocation=full write

Kevin Wolf posted 13 patches 6 years, 9 months ago
There is a newer version of this series
[Qemu-devel] [PULL 03/13] file-posix: Handle EINTR in preallocation=full write
Posted by Kevin Wolf 6 years, 9 months ago
From: Fam Zheng <famz@redhat.com>

Cc: qemu-stable@nongnu.org
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/file-posix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/file-posix.c b/block/file-posix.c
index ad299beb38..928b863ced 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1646,6 +1646,9 @@ static int handle_aiocb_truncate(RawPosixAIOData *aiocb)
             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.13.6