From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Druzhinin <igor.druzhinin@citrix.com>,
keith.busch@intel.com, kwolf@redhat.com, mreitz@redhat.com
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block/nvme: call blk_drain in NVMe reset code to avoid lockups
Date: Tue, 20 Nov 2018 18:52:33 +0100 [thread overview]
Message-ID: <546f9940-6c32-ed30-12a3-e7a4269981f6@redhat.com> (raw)
In-Reply-To: <904b9ea6-0c03-bd8f-0c5b-e3a6d6b3c8b0@citrix.com>
On 20/11/18 18:31, Igor Druzhinin wrote:
> On 14/11/2018 17:42, Igor Druzhinin wrote:
>> On 06/11/2018 12:16, Igor Druzhinin wrote:
>>> When blk_flush called in NVMe reset path S/C queues are already freed
>>> which means that re-entering AIO handling loop having some IO requests
>>> unfinished will lockup or crash as their SG structures being potentially
>>> reused. Call blk_drain before freeing the queues to avoid this nasty
>>> scenario.
>>>
>>> Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
>>> ---
>>> hw/block/nvme.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
>>> index fc7dacb..cdf836e 100644
>>> --- a/hw/block/nvme.c
>>> +++ b/hw/block/nvme.c
>>> @@ -797,6 +797,8 @@ static void nvme_clear_ctrl(NvmeCtrl *n)
>>> {
>>> int i;
>>>
>>> + blk_drain(n->conf.blk);
>>> +
>>> for (i = 0; i < n->num_queues; i++) {
>>> if (n->sq[i] != NULL) {
>>> nvme_free_sq(n->sq[i], n);
>>>
>>
>> ping?
>>
>
> CC: Paolo Bonzini <pbonzini@redhat.com>
>
Looks good to me. Kevin, Max?
Paolo
next prev parent reply other threads:[~2018-11-20 17:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 12:16 [Qemu-devel] [PATCH] block/nvme: call blk_drain in NVMe reset code to avoid lockups Igor Druzhinin
2018-11-14 17:42 ` Igor Druzhinin
2018-11-20 17:31 ` Igor Druzhinin
2018-11-20 17:52 ` Paolo Bonzini [this message]
2018-11-22 14:32 ` 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=546f9940-6c32-ed30-12a3-e7a4269981f6@redhat.com \
--to=pbonzini@redhat.com \
--cc=igor.druzhinin@citrix.com \
--cc=keith.busch@intel.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 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).