qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: quweijie@huayun.com
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	Alberto Garcia <berto@igalia.com>,
	"open list:Quorum" <qemu-block@nongnu.org>,
	quweijie <quweijie@huayun.com>
Subject: [PATCH 1/2] When del child, next_child_index need to subtract 1. Otherwise, the index will get bigger and bigger.
Date: Mon, 11 May 2020 18:00:30 +0800	[thread overview]
Message-ID: <1589191231-18876-1-git-send-email-quweijie@huayun.com> (raw)

From: quweijie <quweijie@huayun.com>

Signed-off-by: quweijie <quweijie@huayun.com>
---
 block/quorum.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/quorum.c b/block/quorum.c
index 6d7a56b..a8272fe 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -1096,6 +1096,7 @@ static void quorum_del_child(BlockDriverState *bs, BdrvChild *child,
     memmove(&s->children[i], &s->children[i + 1],
             (s->num_children - i - 1) * sizeof(BdrvChild *));
     s->children = g_renew(BdrvChild *, s->children, --s->num_children);
+    s->next_child_index--;
     bdrv_unref_child(bs, child);
 
     bdrv_drained_end(bs);
-- 
1.8.3.1



             reply	other threads:[~2020-05-11 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 10:00 quweijie [this message]
2020-05-11 10:00 ` [PATCH 2/2] If we have more than one colo-compare, we can only destroy the lock when we delete the last one quweijie
2020-05-11 10:10 ` [PATCH 1/2] When del child, next_child_index need to subtract 1. Otherwise, the index will get bigger and bigger Alberto Garcia

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=1589191231-18876-1-git-send-email-quweijie@huayun.com \
    --to=quweijie@huayun.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).