On Fri, 23 Sep 2016 13:58:56 +0100
Stefan Hajnoczi <stefa...@redhat.com> wrote:

> On Wed, Sep 21, 2016 at 06:57:20PM +0200, Greg Kurz wrote:
> > @@ -586,13 +589,16 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue 
> > *vq)
> >      blk_io_plug(s->blk);
> >  
> >      while ((req = virtio_blk_get_request(s, vq))) {
> > -        virtio_blk_handle_request(req, &mrb);
> > +        if (virtio_blk_handle_request(req, &mrb)) {
> > +            goto out_err;
> > +        }
> >      }
> >  
> >      if (mrb.num_reqs) {
> >          virtio_blk_submit_multireq(s->blk, &mrb);
> >      }
> >  
> > +out_err:
> >      blk_io_unplug(s->blk);  
> 
> req is leaked.  We must detach it from the virtqueue and free it.
> 
> >  }
> >  
> > @@ -625,7 +631,9 @@ static void virtio_blk_dma_restart_bh(void *opaque)
> >  
> >      while (req) {
> >          VirtIOBlockReq *next = req->next;
> > -        virtio_blk_handle_request(req, &mrb);
> > +        if (virtio_blk_handle_request(req, &mrb)) {
> > +            return;  
> 
> s->rq is leaked.  We must detach and free the remaining requests.  See
> virtio_blk_reset().

I only see virtio_blk_free_request() being called there in QEMU master.

I guess you are talking about the following series ?

[PATCH 0/3] virtio: detach VirtQueueElements freed by reset

<1474291685-24226-1-git-send-email-stefa...@redhat.com>

Cheers.

--
Greg

Attachment: pgpoCAFaAnmRr.pgp
Description: OpenPGP digital signature

Reply via email to