]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
scsi: always call notifier on async cancellation
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 16 Dec 2015 18:33:44 +0000 (19:33 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Dec 2015 16:33:49 +0000 (17:33 +0100)
This was found by code inspection.  If the request is cancelled twice,
the notifier is never called on the second cancellation request,
and hence for example a TMF might never finish.

All the calls in scsi_req_cancel_async are idempotent, so the change
is safe.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1450290827-30508-2-git-send-email-pbonzini@redhat.com>

hw/scsi/scsi-bus.c

index a6000745bdaee53beb19bd941e2575d1113f5540..00bddc92706f011801eaaa24e2badbba73143c75 100644 (file)
@@ -1759,9 +1759,6 @@ void scsi_req_cancel_async(SCSIRequest *req, Notifier *notifier)
     if (notifier) {
         notifier_list_add(&req->cancel_notifiers, notifier);
     }
-    if (req->io_canceled) {
-        return;
-    }
     scsi_req_ref(req);
     scsi_req_dequeue(req);
     req->io_canceled = true;