qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH]hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0
@ 2011-03-09 13:19 Feiran Zheng
  2011-03-09 14:42 ` [Qemu-devel] " Stefano Stabellini
  2011-03-09 15:54 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 2 replies; 4+ messages in thread
From: Feiran Zheng @ 2011-03-09 13:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: anthony.perard, Gerd Hoffmann, Stefano Stabellini

In hw/xen_disk.c, async writing ioreq is leaked when
ioreq->req.nr_segments==0, because `aio_inflight` flag is not released
properly (skipped by misplaced "break").

Signed-off-by: Feiran Zheng <famcool@gmail.com>
---
 hw/xen_disk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index ed9e5eb..445bf03 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -408,9 +408,9 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
        break;
     case BLKIF_OP_WRITE:
     case BLKIF_OP_WRITE_BARRIER:
-        ioreq->aio_inflight++;
         if (!ioreq->req.nr_segments)
             break;
+        ioreq->aio_inflight++;
         bdrv_aio_writev(blkdev->bs, ioreq->start / BLOCK_SIZE,
                         &ioreq->v, ioreq->v.size / BLOCK_SIZE,
                         qemu_aio_complete, ioreq);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-09 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 13:19 [Qemu-devel] [PATCH]hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0 Feiran Zheng
2011-03-09 14:42 ` [Qemu-devel] " Stefano Stabellini
2011-03-09 15:01   ` Stefan Hajnoczi
2011-03-09 15:54 ` [Qemu-devel] " Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).