* [PATCH] block/quorum.c: Decrease child index when del_child
@ 2020-06-01 7:19 Zhang Chen
2020-06-01 10:38 ` Alberto Garcia
0 siblings, 1 reply; 5+ messages in thread
From: Zhang Chen @ 2020-06-01 7:19 UTC (permalink / raw)
To: Alberto Garcia, Kevin Wolf, Max Reitz, qemu-dev
Cc: Jason Wang, Zhang Chen, Zhanghailiang, Dr . David Alan Gilbert,
Zhang Chen
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);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] block/quorum.c: Decrease child index when del_child
2020-06-01 7:19 [PATCH] block/quorum.c: Decrease child index when del_child Zhang Chen
@ 2020-06-01 10:38 ` Alberto Garcia
2020-06-01 18:12 ` Lukas Straub
0 siblings, 1 reply; 5+ messages in thread
From: Alberto Garcia @ 2020-06-01 10:38 UTC (permalink / raw)
To: Zhang Chen, Kevin Wolf, Max Reitz, qemu-dev
Cc: Jason Wang, Zhang Chen, Zhanghailiang, Dr . David Alan Gilbert,
Zhang Chen
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block/quorum.c: Decrease child index when del_child
2020-06-01 10:38 ` Alberto Garcia
@ 2020-06-01 18:12 ` Lukas Straub
2020-06-01 21:41 ` Alberto Garcia
2020-06-02 0:59 ` Zhang, Chen
0 siblings, 2 replies; 5+ messages in thread
From: Lukas Straub @ 2020-06-01 18:12 UTC (permalink / raw)
To: Alberto Garcia
Cc: Kevin Wolf, Zhanghailiang, Jason Wang, qemu-dev, Max Reitz,
Zhang Chen, Zhang Chen, Dr . David Alan Gilbert
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
On Mon, 01 Jun 2020 12:38:32 +0200
Alberto Garcia <berto@igalia.com> wrote:
> 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
>
Hi,
Did you have a look at my series? There it's fixed properly:
https://lore.kernel.org/qemu-devel/9df6b3723ec30cb749ceaa555d82a29a6d79496d.1589199922.git.lukasstraub2@web.de/
Regards,
Lukas Straub
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block/quorum.c: Decrease child index when del_child
2020-06-01 18:12 ` Lukas Straub
@ 2020-06-01 21:41 ` Alberto Garcia
2020-06-02 0:59 ` Zhang, Chen
1 sibling, 0 replies; 5+ messages in thread
From: Alberto Garcia @ 2020-06-01 21:41 UTC (permalink / raw)
To: Lukas Straub
Cc: Kevin Wolf, Zhanghailiang, Jason Wang, qemu-dev, Max Reitz,
Zhang Chen, Zhang Chen, Dr . David Alan Gilbert
On Mon 01 Jun 2020 08:12:00 PM CEST, Lukas Straub wrote:
>> 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
>>
> Hi,
> Did you have a look at my series? There it's fixed properly:
> https://lore.kernel.org/qemu-devel/9df6b3723ec30cb749ceaa555d82a29a6d79496d.1589199922.git.lukasstraub2@web.de/
Oh, I somehow overlooked that, thanks for the reminder!
Berto
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] block/quorum.c: Decrease child index when del_child
2020-06-01 18:12 ` Lukas Straub
2020-06-01 21:41 ` Alberto Garcia
@ 2020-06-02 0:59 ` Zhang, Chen
1 sibling, 0 replies; 5+ messages in thread
From: Zhang, Chen @ 2020-06-02 0:59 UTC (permalink / raw)
To: Lukas Straub, Alberto Garcia
Cc: Kevin Wolf, Zhanghailiang, Jason Wang, qemu-dev,
Dr . David Alan Gilbert, Zhang Chen, Max Reitz
Oh, I missed the patch detail. I just reviewed overall view on your series.
Looks your patch is good for me.
Thanks
Zhang Chen
> -----Original Message-----
> From: Lukas Straub <lukasstraub2@web.de>
> Sent: Tuesday, June 2, 2020 2:12 AM
> To: Alberto Garcia <berto@igalia.com>
> Cc: Zhang, Chen <chen.zhang@intel.com>; Kevin Wolf <kwolf@redhat.com>;
> Max Reitz <mreitz@redhat.com>; qemu-dev <qemu-devel@nongnu.org>;
> Jason Wang <jasowang@redhat.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
>
> On Mon, 01 Jun 2020 12:38:32 +0200
> Alberto Garcia <berto@igalia.com> wrote:
> > 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
> >
>
> Hi,
> Did you have a look at my series? There it's fixed properly:
> https://lore.kernel.org/qemu-
> devel/9df6b3723ec30cb749ceaa555d82a29a6d79496d.1589199922.git.lukasstr
> aub2@web.de/
>
> Regards,
> Lukas Straub
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-02 1:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 7:19 [PATCH] block/quorum.c: Decrease child index when del_child Zhang Chen
2020-06-01 10:38 ` Alberto Garcia
2020-06-01 18:12 ` Lukas Straub
2020-06-01 21:41 ` Alberto Garcia
2020-06-02 0:59 ` Zhang, Chen
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).