[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v3] virtio-blk: Fix double completion for werror

From: Laurent Vivier
Subject: Re: [Qemu-block] [PATCH v3] virtio-blk: Fix double completion for werror=stop
Date: Tue, 17 Nov 2015 16:21:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
>> ---
>> 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 <address@hidden>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]