From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spd1d-0004gO-L0 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Spd1Y-000827-0D for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:23:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spd1X-00081z-O6 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:22:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6DAMwJF029254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Jul 2012 06:22:58 -0400 From: Gerd Hoffmann Date: Fri, 13 Jul 2012 11:44:56 +0200 Message-Id: <1342172696-23587-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1342172696-23587-1-git-send-email-kraxel@redhat.com> References: <1342172696-23587-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] usb-storage: fix SYNCHRONIZE_CACHE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Commit 59310659073d85745854f2f10c4292555c5a1c51 is incomplete, we'll arrive in the scsi command complete callback in CSW state and must handle that case correctly. Signed-off-by: Gerd Hoffmann --- hw/usb/dev-storage.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index f1d8082..97059d3 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -247,6 +247,9 @@ static void usb_msd_command_complete(SCSIRequest *req, uint32_t status, size_t r the status read packet. */ usb_msd_send_status(s, p); s->mode = USB_MSDM_CBW; + } else if (s->mode == USB_MSDM_CSW) { + usb_msd_send_status(s, p); + s->mode = USB_MSDM_CBW; } else { if (s->data_len) { int len = (p->iov.size - p->result); -- 1.7.1