qemu-devel
[Top][All Lists]
Advanced

[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: Changlong Xie
Subject: Re: [Qemu-devel] [PATCH V2] quorum: fix segfault when read fails in fifo mode
Date: Mon, 15 Feb 2016 13:08:08 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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 <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.

Hi Eric

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

Thanks
        -Xie






reply via email to

[Prev in Thread] Current Thread [Next in Thread]