[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at syste
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] virtio-blk: Release s->rq queue at system_reset |
Date: |
Wed, 3 Aug 2016 08:52:42 +0800 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Tue, 08/02 13:00, Paolo Bonzini wrote:
>
> > I'd prefer if Paolo's remark (about blk_drain()'s ability to produce
> > more failed requests, stashed in s->rq) were captured in either the
> > commit message, or in a code comment. Something like:
> >
> > /* We drop queued requests after blk_drain() because blk_drain()
> > * itself can produce them. */
>
> It's also (perhaps especially) because blk_drain() can consume them. Fam's
> patch to do blk_drain() first would cause a double-free.
That "consume" part is what I don't understand.
Shouldn't blk_drain() only process submitted requests (and further requests
they dequeue indirectly), while s->rq only contains failed requests. They don't
look overlap, because I suppose failed requests are only going to be processed
by run state change.
What am I missing?
Fam
[Qemu-devel] [PATCH v2 2/2] virtio-blk: Remove stale comment about draining, Fam Zheng, 2016/08/02