Skip to contentSkip to conversation

scsi: Fix scsi_req_cancel_async for no aiocb req

PATCH Applied Fam Zheng 2 participants 2 messages Jan 27, 2015 – Jan 28, 2015

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 scsi: Fix scsi_req_cancel_async for no aiocb req

scsi_req_cancel_complete is responsible for releasing the request, so we shouldn't skip it in any case. This doesn't affect the only existing caller, virtio-scsi, but is useful for other devices once they use it.

---
 hw/scsi/scsi-bus.c | 2 ++
 1 file changed, 2 insertions(+)
hw/scsi/scsi-bus.c +2 -0
index 9b740a3..db39ae0 100644
@@ -1756,6 +1756,8 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
     req->io_canceled = true;
     if (req->aiocb) {
         blk_aio_cancel_async(req->aiocb);
+    } else {
+        scsi_req_cancel_complete(req);
     }
 }
 
Signature · 1 line
1.9.3
#1 lore raw
Quoted 16 lines · Fam Zheng

scsi_req_cancel_complete is responsible for releasing the request, so we shouldn't skip it in any case. This doesn't affect the only existing caller, virtio-scsi, but is useful for other devices once they use it.

---
 hw/scsi/scsi-bus.c | 2 ++
 1 file changed, 2 insertions(+)
hw/scsi/scsi-bus.c +0 -0
index 9b740a3..db39ae0 100644

hw/scsi/scsi-bus.c void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier) · line 1763

Quoted 8 lines
hw/scsi/scsi-bus.c +2 -0
@@ -1756,6 +1756,8 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
     req->io_canceled = true;
     if (req->aiocb) {
         blk_aio_cancel_async(req->aiocb);
+    } else {
+        scsi_req_cancel_complete(req);
     }
 }
 

Applied, thanks.

Paolo