From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9H0b-0002XQ-LI for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:41:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9H0W-0007be-MA for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:41:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9H0W-0007ba-HD for qemu-devel@nongnu.org; Wed, 16 Dec 2015 13:41:00 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id AE2333BEB5 for ; Wed, 16 Dec 2015 18:33:51 +0000 (UTC) From: Paolo Bonzini Date: Wed, 16 Dec 2015 19:33:44 +0100 Message-Id: <1450290827-30508-2-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] scsi: always call notifier on async cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: famz@redhat.com 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. Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 524a998..4c121fe 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -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; -- 2.5.0