All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] block: Invalidate all children
Date: Tue, 19 Apr 2016 16:44:45 +0800	[thread overview]
Message-ID: <5715EFFD.3050508@cn.fujitsu.com> (raw)
In-Reply-To: <1461030177-29144-2-git-send-email-famz@redhat.com>

On 04/19/2016 09:42 AM, Fam Zheng wrote:
> Currently we only recurse to bs->file, which will miss the children in quorum
> and VMDK.
>
> Recurse into the whole subtree to avoid that.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>   block.c | 20 ++++++++++++++------
>   1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/block.c b/block.c
> index d4939b4..fa8b38f 100644
> --- a/block.c
> +++ b/block.c
> @@ -3201,6 +3201,7 @@ void bdrv_init_with_whitelist(void)
>
>   void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
>   {
> +    BdrvChild *child;
>       Error *local_err = NULL;
>       int ret;
>
> @@ -3215,13 +3216,20 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
>
>       if (bs->drv->bdrv_invalidate_cache) {
>           bs->drv->bdrv_invalidate_cache(bs, &local_err);

Kevin's commit 3456a8d1 introduced unexpected two spaces in this 
function, would you like remove it?

-    if (bs->drv && bs->drv->bdrv_invalidate_cache) {
+    if (!bs->drv)  {
+        return;
+    }

> -    } else if (bs->file) {
> -        bdrv_invalidate_cache(bs->file->bs, &local_err);
> +        if (local_err) {
> +            bs->open_flags |= BDRV_O_INACTIVE;
> +            error_propagate(errp, local_err);
> +            return;
> +        }
>       }
> -    if (local_err) {
> -        bs->open_flags |= BDRV_O_INACTIVE;
> -        error_propagate(errp, local_err);
> -        return;
> +
> +    QLIST_FOREACH(child, &bs->children, next) {
> +        bdrv_invalidate_cache(child->bs, &local_err);
> +        if (local_err) {
> +            bs->open_flags |= BDRV_O_INACTIVE;
> +            error_propagate(errp, local_err);
> +            return;

If we really need return here? I just mean for example, Quorum A has 3 
children(children.0, children.1, children.2), if we invalidate 
children.1 failed, then we are not going to invalidate children.2

> +        }
>       }
>
>       ret = refresh_total_sectors(bs, bs->total_sectors);
>

  reply	other threads:[~2016-04-19  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19  1:42 [Qemu-devel] [PATCH 0/2] block: More complete inactivate/invalidate of on graph Fam Zheng
2016-04-19  1:42 ` [Qemu-devel] [PATCH 1/2] block: Invalidate all children Fam Zheng
2016-04-19  8:44   ` Changlong Xie [this message]
2016-04-19 12:23     ` Fam Zheng
2016-05-04 10:10   ` Kevin Wolf
2016-05-05  0:32     ` Fam Zheng
2016-04-19  1:42 ` [Qemu-devel] [PATCH 2/2] block: Inactivate " Fam Zheng
2016-05-04 10:12   ` Kevin Wolf
2016-05-05  0:32     ` Fam Zheng
2016-05-06  7:49       ` Kevin Wolf
2016-05-10  3:23         ` Fam Zheng
2016-05-10  8:33           ` Kevin Wolf
2016-05-11  1:51             ` Fam Zheng

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=5715EFFD.3050508@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.com \
    --cc=famz@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.