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