diff options
| author | Max Reitz | 2018-02-28 14:13:14 +0100 |
|---|---|---|
| committer | Max Reitz | 2018-04-03 17:39:37 +0200 |
| commit | 82b45e0a0b824787bd79ce3f6453eaa2afddd138 (patch) | |
| tree | c4ee6e328b99659949226314bbf6cdbbee1ed361 /include/exec/memory.h | |
| parent | iotests: Update 186 after commit ac64273c66ab136c44043259162 (diff) | |
| download | qemu-82b45e0a0b824787bd79ce3f6453eaa2afddd138.tar.gz qemu-82b45e0a0b824787bd79ce3f6453eaa2afddd138.tar.xz qemu-82b45e0a0b824787bd79ce3f6453eaa2afddd138.zip | |
block/file-posix: Fix fully preallocated truncate
Storing the lseek() result in an int results in it overflowing when the
file is at least 2 GB big. Then, we have a 50 % chance of the result
being "negative" and thus thinking an error occurred when actually
everything went just fine.
So we should use the correct type for storing the result: off_t.
Reported-by: Daniel P. Berrange <berrange@redhat.com>
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1549231
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20180228131315.30194-2-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/exec/memory.h')
0 files changed, 0 insertions, 0 deletions
