[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo mode |
Date: |
Fri, 5 Feb 2016 08:46:31 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 02/04/2016 07:25 PM, Changlong Xie wrote:
> Signed-off-by: Wen Congyang <address@hidden>
> Signed-off-by: Changlong Xie <address@hidden>
> ---
> block/quorum.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/quorum.c b/block/quorum.c
> index a5ae4b8..11cc60b 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -286,7 +286,8 @@ static void quorum_aio_cb(void *opaque, int ret)
>
> if (acb->is_read && s->read_pattern == QUORUM_READ_PATTERN_FIFO) {
> /* We try to read next child in FIFO order if we fail to read */
> - if (ret < 0 && ++acb->child_iter < s->num_children) {
> + if (ret < 0 && (acb->child_iter + 1) < s->num_children) {
Could shorten this as
if (ret < 0 && acb->child_iter <= s->num_children) {
but I'm not sure it's worth the mental gymnastics.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature