All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: Eric Blake <eblake@redhat.com>,
	qemu devel <qemu-devel@nongnu.org>,
	Alberto Garcia <berto@igalia.com>, Kevin Wolf <kwolf@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo mode
Date: Mon, 15 Feb 2016 13:08:08 +0800	[thread overview]
Message-ID: <56C15D38.3010409@cn.fujitsu.com> (raw)
In-Reply-To: <56B4C3D7.4040404@redhat.com>

On 02/05/2016 11:46 PM, Eric Blake wrote:
> On 02/04/2016 07:25 PM, Changlong Xie wrote:
>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
>> ---
>>   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.

Hi Eric

Just the same to me. Since it has been applied to block branch. Let's 
keep the original one.

Thanks
	-Xie
>

      reply	other threads:[~2016-02-15  5:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  2:25 [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo mode Changlong Xie
2016-02-05 13:28 ` Alberto Garcia
2016-02-05 15:47   ` Kevin Wolf
2016-02-05 15:46 ` Eric Blake
2016-02-15  5:08   ` Changlong Xie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C15D38.3010409@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.com \
    --cc=berto@igalia.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.