Re: [Qemu-stable] [Qemu-devel] fixing qemu-0.1X endless loop in qcow2_al
From:
周洲仪
Subject:
Re: [Qemu-stable] [Qemu-devel] fixing qemu-0.1X endless loop in qcow2_alloc_cluster_offset
Date:
Tue, 16 Oct 2012 11:32:02 +0800 (GMT+08:00)
Hi Kevin > Am 15.10.2012 16:28, schrieb Andreas Färber: > >> What I'm suggesting (not even compile tested!) is: > >> > >> Signed-off-by: Kevin Wolf <address@hidden> > >> > >> diff --git a/block/qcow2.c b/block/qcow2.c > >> index 48e1b95..d665675 100644 > >> --- a/block/qcow2.c > >> +++ b/block/qcow2.c > >> @@ -388,10 +388,7 @@ typedef struct QCowAIOCB { > >> > >> static void qcow2_aio_cancel(BlockDriverAIOCB *blockacb) > >> { > >> - QCowAIOCB *acb = container_of(blockacb, QCowAIOCB, common); > >> - if (acb->hd_aiocb) > >> - bdrv_aio_cancel(acb->hd_aiocb); > >> - qemu_aio_release(acb); > >> + qemu_aio_flush(); > >> } > >> > >> static AIOPool qcow2_aio_pool = { > > > > Compiles fine. Is there a particular test case to invoke this code path? > > As far as I know, the common way to get this were IDE resets. However, > I'm not sure what you need to do with a Linux guest if you want it to > reset the IDE controller...
I first notice this bug during the stress test of FreeBSD9.0 guests. FreeBSD will issue a ata reset servicing function ata_timeout. A way to speed up the frequency of invoking ata_timeout is to modify the function ata_begin_transaction and let the timeout shorter then do a disk intensive stress test.
under FreeBSD, invoke atacontro reinit ata0 may do the reset, Under Linux, invoke hdparm -w will also do the work? (dangerous, a safe way maybe modify Linux kernel and let the ata request timeout shorter?)
> > Does this attempt to fix the cluster leaks you mentioned as well, or > > just the cluster allocation endless loop? > > Instead of cancelling the in-flight requests it waits for their > completion, so in the end we should be in an consistent state without > cluster leaks. > Zhouyi