From: Wen Congyang <wency@cn.fujitsu.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: benoit.canet@irqsave.net, Jeff Cody <jcody@redhat.com>,
Fam Zheng <famz@redhat.com>, qemu-devl <qemu-devel@nongnu.org>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] more check for replaced node
Date: Fri, 17 Jul 2015 09:35:57 +0800 [thread overview]
Message-ID: <55A85BFD.1010408@cn.fujitsu.com> (raw)
In-Reply-To: <20150716133601.GF16984@stefanha-thinkpad.redhat.com>
On 07/16/2015 09:36 PM, Stefan Hajnoczi wrote:
> On Wed, Jul 15, 2015 at 11:22:52AM +0800, Wen Congyang wrote:
>> On 07/15/2015 11:05 AM, Fam Zheng wrote:
>>> On Wed, 07/15 09:41, Wen Congyang wrote:
>>>> We use mirror+replace to fix quorum's broken child. bs/s->common.bs
>>>> is quorum, and to_replace is the broken child. The new child is target_bs.
>>>> Without this patch, the replace node can be any node, and it can be
>>>> top BDS with BB, or another quorum's child. We just check if the broken
>>>> child is part of the quorum BDS in this patch.
>>>>
>>>> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>>>> ---
>>>> block.c | 5 +++--
>>>> block/mirror.c | 3 ++-
>>>> blockdev.c | 2 +-
>>>> include/block/block.h | 3 ++-
>>>> 4 files changed, 8 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/block.c b/block.c
>>>> index d088ee0..090923c 100644
>>>> --- a/block.c
>>>> +++ b/block.c
>>>> @@ -4077,7 +4077,8 @@ bool bdrv_is_first_non_filter(BlockDriverState *candidate)
>>>> return false;
>>>> }
>>>>
>>>> -BlockDriverState *check_to_replace_node(const char *node_name, Error **errp)
>>>> +BlockDriverState *check_to_replace_node(BlockDriverState *parent_bs,
>>>> + const char *node_name, Error **errp)
>>>> {
>>>> BlockDriverState *to_replace_bs = bdrv_find_node(node_name);
>>>> AioContext *aio_context;
>>>> @@ -4100,7 +4101,7 @@ BlockDriverState *check_to_replace_node(const char *node_name, Error **errp)
>>>> * Another benefit is that this tests exclude backing files which are
>>>> * blocked by the backing blockers.
>>>> */
>>>> - if (!bdrv_is_first_non_filter(to_replace_bs)) {
>>>> + if (!bdrv_recurse_is_first_non_filter(parent_bs, to_replace_bs)) {
>>>> error_setg(errp, "Only top most non filter can be replaced");
>>>> to_replace_bs = NULL;
>>>> goto out;
>>>> diff --git a/block/mirror.c b/block/mirror.c
>>>> index 238a070..b81077e 100644
>>>> --- a/block/mirror.c
>>>> +++ b/block/mirror.c
>>>> @@ -626,7 +626,8 @@ static void mirror_complete(BlockJob *job, Error **errp)
>>>> if (s->replaces) {
>>>> AioContext *replace_aio_context;
>>>>
>>>> - s->to_replace = check_to_replace_node(s->replaces, &local_err);
>>>> + s->to_replace = check_to_replace_node(s->common.bs, s->replaces,
>>>> + &local_err);
>>>
>>> Why is the check in qmp_drive_mirror not enough? Isn't this redundant?
>>
>> I don't know why we check it twice. And I think it is redundant too.
>
> Okay, does that mean you are dropping this patch now?
>
No, we call check_to_replace_node() twice. So we can remove it from mirror_complete().
Will update it in the next version.
Thanks
Wen Congyang
next prev parent reply other threads:[~2015-07-17 1:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 1:41 [Qemu-devel] [PATCH v2] more check for replaced node Wen Congyang
2015-07-15 3:05 ` Fam Zheng
2015-07-15 3:22 ` Wen Congyang
2015-07-16 13:36 ` Stefan Hajnoczi
2015-07-17 1:35 ` Wen Congyang [this message]
2015-07-17 1:37 ` Wen Congyang
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=55A85BFD.1010408@cn.fujitsu.com \
--to=wency@cn.fujitsu.com \
--cc=benoit.canet@irqsave.net \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.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).