From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cej-0002Ey-BH for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:48:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9cei-00071r-Fk for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:47:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9cei-00071i-Az for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:47:56 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id EBE32693DB for ; Thu, 17 Dec 2015 17:47:55 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBHHkfcj014618 for ; Thu, 17 Dec 2015 12:47:55 -0500 From: Paolo Bonzini Date: Thu, 17 Dec 2015 18:46:39 +0100 Message-Id: <1450374401-31352-44-git-send-email-pbonzini@redhat.com> In-Reply-To: <1450374401-31352-1-git-send-email-pbonzini@redhat.com> References: <1450374401-31352-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 43/45] scsi: always call notifier on async cancellation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Paolo Bonzini Message-Id: <1450290827-30508-2-git-send-email-pbonzini@redhat.com> --- 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 a600074..00bddc9 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