qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-stable@nongnu.org, qemu-devel@nongnu.org,
	mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] blockdev: use drained_begin/end for qmp_block_resize
Date: Wed, 10 May 2017 13:32:36 -0500	[thread overview]
Message-ID: <b827fdb5-2385-6e21-ec06-0787b0a756af@redhat.com> (raw)
In-Reply-To: <20170510173945.11819-1-jsnow@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]

On 05/10/2017 12:39 PM, John Snow wrote:
> Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1447551
> 
> If one tries to issue a block_resize while a guest is busy
> accessing the disk, it is possible that qemu may deadlock
> when invoking aio_poll from both the main loop and the iothread.
> 
> Replace another instance of bdrv_drain_all that doesn't
> quite belong.
> 
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  blockdev.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/blockdev.c b/blockdev.c
> index 0b38c3d..9ff06f3 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2923,10 +2923,9 @@ void qmp_block_resize(bool has_device, const char *device,
>          goto out;
>      }
>  
> -    /* complete all in-flight operations before resizing the device */
> -    bdrv_drain_all();
> -
> +    bdrv_drained_begin(bs);
>      ret = blk_truncate(blk, size, errp);
> +    bdrv_drained_end(bs);
>  
>  out:
>      blk_unref(blk);
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2017-05-10 18:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 17:39 [Qemu-devel] [PATCH] blockdev: use drained_begin/end for qmp_block_resize John Snow
2017-05-10 18:32 ` Eric Blake [this message]
2017-05-11  7:53 ` Paolo Bonzini
2017-05-11  9:26 ` Kevin Wolf

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=b827fdb5-2385-6e21-ec06-0787b0a756af@redhat.com \
    --to=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --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).