[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [STABLE PATCH 1/6] ide: Fix ide_dma_cancel
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [STABLE PATCH 1/6] ide: Fix ide_dma_cancel |
Date: |
Fri, 28 May 2010 20:01:27 +0200 |
When cancelling a request, bdrv_aio_cancel may decide that it waits for
completion of a request rather than for cancellation. IDE therefore can't
abandon its DMA status before calling bdrv_aio_cancel; otherwise the callback
of a completed request would use invalid data.
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 38d8dfa193e9a45f0f08b06aab2ba2a94f40a041)
---
hw/ide/core.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 64aebc2..f9bb338 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2827,10 +2827,6 @@ static void ide_dma_restart(IDEState *s, int is_read)
void ide_dma_cancel(BMDMAState *bm)
{
if (bm->status & BM_STATUS_DMAING) {
- bm->status &= ~BM_STATUS_DMAING;
- /* cancel DMA request */
- bm->unit = -1;
- bm->dma_cb = NULL;
if (bm->aiocb) {
#ifdef DEBUG_AIO
printf("aio_cancel\n");
@@ -2838,6 +2834,10 @@ void ide_dma_cancel(BMDMAState *bm)
bdrv_aio_cancel(bm->aiocb);
bm->aiocb = NULL;
}
+ bm->status &= ~BM_STATUS_DMAING;
+ /* cancel DMA request */
+ bm->unit = -1;
+ bm->dma_cb = NULL;
}
}
--
1.6.6.1
- [Qemu-devel] [STABLE PULL 0/6] Block patches for 0.12.x, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 6/6] qcow2: Fix corruption after error in update_refcount, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 4/6] block: Fix multiwrite with overlapping requests, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 5/6] qcow2: Fix corruption after refblock allocation, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 3/6] qcow2: Fix error handling in l2_allocate, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 2/6] qcow2: Clear L2 table cache after write error, Kevin Wolf, 2010/05/28
- [Qemu-devel] [STABLE PATCH 1/6] ide: Fix ide_dma_cancel,
Kevin Wolf <=