[prev in list] [next in list] [prev in thread] [next in thread]
List: qemu-block
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] block: Avoid copy-on-read assertions
From: Eric Blake <eblake () redhat ! com>
Date: 2017-09-30 22:05:34
Message-ID: 4cac1113-5d6a-3dd1-1ef0-6fde5482a125 () redhat ! com
[Download RAW message or body]
[Attachment #2 (multipart/mixed)]
On 09/30/2017 04:19 PM, no-reply@patchew.org wrote:
> Hi,
>
> This series failed build test on s390x host. Please find the details below.
>
> /var/tmp/patchew-tester-tmp-a2p2tpcc/src/block/io.c: In function \
> ‘bdrv_aligned_preadv':
> /var/tmp/patchew-tester-tmp-a2p2tpcc/src/block/io.c:955:9: error: ‘ret' may be \
> used uninitialized in this function [-Werror=maybe-uninitialized] int ret;
> ^~~
Blah - I compiled with -g instead of -O2, which masks this warning in my
setup.
The warning is a false negative (the error message is actually pointing
to a line in bdrv_co_do_copy_on_readv - but the compiler must have
inlined it into bdrv_aligned_preadv) - the function is only ever called
with non-zero bytes, and therefore the 'while (cluster_bytes)' loop will
execute at least once, and ret always gets assigned. But the compiler
can't see that, so I'll squash this in:
commit a201636c3133827bd632d5fdd9eb1f5df81d0e0e
Author: Eric Blake <eblake@redhat.com>
Date: Sat Sep 30 14:27:51 2017 -0500
fixup! block: Perform copy-on-read in loop
Signed-off-by: Eric Blake <eblake@redhat.com>
diff --git a/block/io.c b/block/io.c
index 5ef5adc7a7..e7519464bb 100644
--- a/block/io.c
+++ b/block/io.c
@@ -952,7 +952,7 @@ static int coroutine_fn
bdrv_co_do_copy_on_readv(BdrvChild *child,
int64_t cluster_offset;
unsigned int cluster_bytes;
size_t skip_bytes;
- int ret;
+ int ret = 0;
int max_transfer = MIN_NON_ZERO(bs->bl.max_transfer,
BDRV_REQUEST_MAX_BYTES);
unsigned int progress = 0;
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic