[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts |
Date: |
Tue, 30 Nov 2010 18:58:05 +0100 |
From: Stefan Hajnoczi <address@hidden>
SCSI read/write requests should not be re-issued before the current
fragment of I/O completes. There are asserts in scsi-disk.c that guard
this constraint but they trigger on SPARC Linux 2.4. It turns out that
the asserts are too early in the code path and don't allow for read
requests to terminate.
Only the read assert needs to be moved but move the write assert too for
consistency.
Reported-by: Nigel Horne <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/scsi-disk.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index dc71957..7d85899 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -170,6 +170,9 @@ static void scsi_read_request(SCSIDiskReq *r)
return;
}
+ /* No data transfer may already be in progress */
+ assert(r->req.aiocb == NULL);
+
n = r->sector_count;
if (n > SCSI_DMA_BUF_SIZE / 512)
n = SCSI_DMA_BUF_SIZE / 512;
@@ -197,9 +200,6 @@ static void scsi_read_data(SCSIDevice *d, uint32_t tag)
return;
}
- /* No data transfer may already be in progress */
- assert(r->req.aiocb == NULL);
-
scsi_read_request(r);
}
@@ -269,6 +269,9 @@ static void scsi_write_request(SCSIDiskReq *r)
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
uint32_t n;
+ /* No data transfer may already be in progress */
+ assert(r->req.aiocb == NULL);
+
n = r->iov.iov_len / 512;
if (n) {
qemu_iovec_init_external(&r->qiov, &r->iov, 1);
@@ -298,9 +301,6 @@ static int scsi_write_data(SCSIDevice *d, uint32_t tag)
return 1;
}
- /* No data transfer may already be in progress */
- assert(r->req.aiocb == NULL);
-
scsi_write_request(r);
return 0;
--
1.7.2.3
- [Qemu-devel] [PATCH 11/16] scsi-disk: Remove duplicate cdb parsing, (continued)
- [Qemu-devel] [PATCH 11/16] scsi-disk: Remove duplicate cdb parsing, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 13/16] ide: Factor ide_dma_set_inactive out, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 07/16] scsi: Increase the number of possible devices, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 04/16] ide: convert bmdma address ioport to ioport_register(), Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 14/16] ide: Set bus master inactive on error, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 12/16] raw-posix: raw_pwrite comment fixup, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 10/16] scsi: Move sense handling into the driver, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 08/16] scsi: Return SAM status codes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barriers in xen_disk, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 09/16] scsi: INQUIRY VPD fixes, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts,
Kevin Wolf <=
- [Qemu-devel] [PATCH 02/16] Implement drive_del to decouple block removal from device removal, Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs for same sector (v2), Kevin Wolf, 2010/11/30
- [Qemu-devel] [PATCH 16/16] ide: Reset current_addr after stopping DMA, Kevin Wolf, 2010/11/30