aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-03 17:48:45 +0200
committerKevin Wolf <kwolf@redhat.com>2018-04-03 17:48:45 +0200
commit9c1386d3ff76c5983529884e3d8420df958c5a29 (patch)
tree4a78266d8ebbfa59a65a441b89070b3708089053 /block
parenteb42e7193e74a8e51603d0190340d4983eb58002 (diff)
parentabd3622cc03cf41ed542126a540385f30a4c0175 (diff)
downloadqemu-9c1386d3ff76c5983529884e3d8420df958c5a29.zip
qemu-9c1386d3ff76c5983529884e3d8420df958c5a29.tar.gz
qemu-9c1386d3ff76c5983529884e3d8420df958c5a29.tar.bz2
Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into queue-block
A fix for preallocated truncation, a new iotest, and a fix to make the iotests work more comfortably on ppc64 # gpg: Signature made Tue Apr 3 17:40:57 2018 CEST # gpg: using RSA key F407DB0061D5CF40 # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * mreitz/tags/pull-block-2018-04-03: iotests: Test abnormally large size in compressed cluster descriptor qemu-iotests: Use ppc64 qemu_arch on ppc64le host iotests: Test preallocated truncate of 2G image block/file-posix: Fix fully preallocated truncate Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/file-posix.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/file-posix.c b/block/file-posix.c
index a2f6d8a..3794c00 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1701,6 +1701,7 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
case PREALLOC_MODE_FULL:
{
int64_t num = 0, left = offset - current_length;
+ off_t seek_result;
/*
* Knowing the final size from the beginning could allow the file
@@ -1715,8 +1716,8 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc,
buf = g_malloc0(65536);
- result = lseek(fd, current_length, SEEK_SET);
- if (result < 0) {
+ seek_result = lseek(fd, current_length, SEEK_SET);
+ if (seek_result < 0) {
result = -errno;
error_setg_errno(errp, -result,
"Failed to seek to the old end of file");