Skip to contentSkip to conversation

scsi: fix cancellation when I/O was completed but DMA was not.

PATCH New Paolo Bonzini 1 participant 1 message Jan 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: fix cancellation when I/O was completed but DMA was not.

Commit d577646 (scsi: Introduce scsi_req_cancel_complete, 2014-09-25) was supposed to have no semantic change, but it missed a case. When r->aiocb has already been NULLed, but DMA was not complete and the SCSI layer was waiting for scsi_req_continue, after the patch the SCSI layer will not call the .cancel callback of SCSIBusInfo.

Fixes d5776465ee9a55815792efa34d79de240f4ffd99
---
 hw/scsi/scsi-bus.c | 2 ++
 1 file changed, 2 insertions(+)
hw/scsi/scsi-bus.c +2 -0
index 24f7b74..9b740a3 100644
@@ -1770,6 +1770,8 @@ void scsi_req_cancel(SCSIRequest *req)
     req->io_canceled = true;
     if (req->aiocb) {
         blk_aio_cancel(req->aiocb);
+    } else {
+        scsi_req_cancel_complete(req);
     }
 }
 
Signature · 1 line
1.8.3.1