All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, pl@kamp.de, qemu-devel@nongnu.org,
	qemu-stable@nongnu.org, pbonzini@redhat.com, dgibson@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3] virtio-blk: Fix double completion for werror=stop
Date: Tue, 17 Nov 2015 16:21:43 +0100	[thread overview]
Message-ID: <564B4607.4060807@redhat.com> (raw)
In-Reply-To: <20151117103428.GA27541@stefanha-x1.localdomain>



On 17/11/2015 11:34, Stefan Hajnoczi wrote:
> On Tue, Nov 17, 2015 at 06:20:11PM +0800, Fam Zheng wrote:
>> When a request R is absorbed by request M, it is appended to the
>> "mr_next" queue led by M, and is completed together with the completion
>> of M, in virtio_blk_rw_complete.
>>
>> During DMA restart in virtio_blk_dma_restart_bh, requests in s->rq are
>> parsed and submitted again, possibly with a stale req->mr_next. It could
>> be a problem if the request merging in virtio_blk_handle_request hasn't
>> refreshed every mr_next pointer, in which case, virtio_blk_rw_complete
>> could walk through unexpected requests following the stale pointers.
>>
>> Fix this by unsetting the pointer in virtio_blk_rw_complete. It is safe
>> because this req is either completed and freed right away, or it will be
>> restarted and parsed from scratch out of the vq later.
>>
>> Signed-off-by: Fam Zheng <famz@redhat.com>
>>
>> ---
>>
>> v3: Fix as Stefan suggested.
>> ---
>>  hw/block/virtio-blk.c | 4 ++++
>>  1 file changed, 4 insertions(+)
> 
> Thanks, applied to my block tree:
> https://github.com/stefanha/qemu/commits/block

I have also tested this one and it works fine.

Tested-by: Laurent Vivier <lvivier@redhat.com>

Laurent

  reply	other threads:[~2015-11-17 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 10:20 [Qemu-devel] [PATCH v3] virtio-blk: Fix double completion for werror=stop Fam Zheng
2015-11-17 10:34 ` Stefan Hajnoczi
2015-11-17 15:21   ` Laurent Vivier [this message]
2015-11-22 19:41 ` Paolo Bonzini
2015-11-23  0:39   ` 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=564B4607.4060807@redhat.com \
    --to=lvivier@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --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 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.