From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH] scsi-disk: release AioContext in unaligned WRITE SAME case
Date: Thu, 4 Jan 2018 15:28:33 +0100 [thread overview]
Message-ID: <67d581de-b882-0677-a3de-4f9d542d49e0@redhat.com> (raw)
In-Reply-To: <20180104142502.15175-1-stefanha@redhat.com>
On 04/01/2018 15:25, Stefan Hajnoczi wrote:
> scsi_write_same_complete() can retry the write if the request was
> unaligned. Make sure to release the AioContext when that code path is
> taken!
>
> This patch fixes a hang when QEMU terminates after an unaligned WRITE
> SAME request has been processed with dataplane. The hang occurs because
> iothread_stop_all() cannot acquire the AioContext lock that was leaked
> by the IOThread in scsi_write_same_complete().
>
> Fixes: b9e413dd37
> ("block: explicitly acquire aiocontext in aio callbacks that need it").
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Reported-by: Cong Li <coli@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> hw/scsi/scsi-disk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
> index e58833a087..49d2559d93 100644
> --- a/hw/scsi/scsi-disk.c
> +++ b/hw/scsi/scsi-disk.c
> @@ -1755,6 +1755,7 @@ static void scsi_write_same_complete(void *opaque, int ret)
> data->sector << BDRV_SECTOR_BITS,
> &data->qiov, 0,
> scsi_write_same_complete, data);
> + aio_context_release(blk_get_aio_context(s->qdev.conf.blk));
> return;
> }
>
>
Queued,t hanks!
Paolo
prev parent reply other threads:[~2018-01-04 14:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 14:25 [Qemu-devel] [PATCH] scsi-disk: release AioContext in unaligned WRITE SAME case Stefan Hajnoczi
2018-01-04 14:28 ` Paolo Bonzini [this message]
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=67d581de-b882-0677-a3de-4f9d542d49e0@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@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).