diff options
author | Fam Zheng <famz@redhat.com> | 2018-07-27 14:53:14 +0800 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2018-07-31 11:54:59 -0500 |
commit | aae299a68ddb1945e571487b3de8f20e4366a225 (patch) | |
tree | f7392870412288ffc2c6eddc339128b8232e78b8 | |
parent | b102aea574939d93b996a01c1aebc49a30e2bb15 (diff) |
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 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>
-rw-r--r-- | block/file-posix.c | 3 |
1 files changed, 3 insertions, 0 deletions
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"); |