qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: Zhang Chen <chen.zhang@intel.com>, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>, qemu-dev <qemu-devel@nongnu.org>
Cc: Jason Wang <jasowang@redhat.com>,
	Zhang Chen <chen.zhang@intel.com>,
	Zhanghailiang <zhang.zhanghailiang@huawei.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Zhang Chen <zhangckid@gmail.com>
Subject: Re: [PATCH] block/quorum.c: Decrease child index when del_child
Date: Mon, 01 Jun 2020 12:38:32 +0200	[thread overview]
Message-ID: <w515zcbm5p3.fsf@maestria.local.igalia.com> (raw)
In-Reply-To: <20200601071956.18006-1-chen.zhang@intel.com>

On Mon 01 Jun 2020 09:19:56 AM CEST, Zhang Chen wrote:
> From: Zhang Chen <chen.zhang@intel.com>
>
> Fix this bug:
> colo: Can not recover colo after svm failover twice
> https://bugs.launchpad.net/bugs/1881231
>
> The child index still be hold when it be deleted, the max num is 32.
>
> Reported-by: Ye.Zou <ye.zou@zstack.io>
> Signed-off-by: Zhang Chen <chen.zhang@intel.com>
> ---
>  block/quorum.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/block/quorum.c b/block/quorum.c
> index 7cf7ab1546..f71bd4e19d 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -1099,6 +1099,7 @@ static void quorum_del_child(BlockDriverState *bs, BdrvChild *child,
>              (s->num_children - i - 1) * sizeof(BdrvChild *));
>      s->children = g_renew(BdrvChild *, s->children, --s->num_children);
>      bdrv_unref_child(bs, child);
> +    s->next_child_index--;
>  
>      bdrv_drained_end(bs);
>  }

As I explained a few weeks ago this patch is not correct.
quorum_del_child() allows you to remove any child from the Quorum
device, so nothing guarantees that next_child_index-1 is free.

https://lists.gnu.org/archive/html/qemu-block/2020-05/msg00634.html

Berto


  reply	other threads:[~2020-06-01 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  7:19 [PATCH] block/quorum.c: Decrease child index when del_child Zhang Chen
2020-06-01 10:38 ` Alberto Garcia [this message]
2020-06-01 18:12   ` Lukas Straub
2020-06-01 21:41     ` Alberto Garcia
2020-06-02  0:59     ` Zhang, Chen

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=w515zcbm5p3.fsf@maestria.local.igalia.com \
    --to=berto@igalia.com \
    --cc=chen.zhang@intel.com \
    --cc=dgilbert@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    --cc=zhangckid@gmail.com \
    /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).