From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TulwY-00049l-7t for qemu-devel@nongnu.org; Mon, 14 Jan 2013 10:27:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TulwS-0002nQ-B5 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 10:27:22 -0500 Received: from mail-qc0-f181.google.com ([209.85.216.181]:42051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TulwS-0002nK-43 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 10:27:16 -0500 Received: by mail-qc0-f181.google.com with SMTP id x40so2594974qcp.12 for ; Mon, 14 Jan 2013 07:27:15 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 14 Jan 2013 16:26:56 +0100 Message-Id: <1358177218-16802-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1358177218-16802-1-git-send-email-pbonzini@redhat.com> References: <1358177218-16802-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 5/7] ide: fix TRIM with empty range entry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com ATA-ACS-3 says "If the two byte range length is zero, then the LBA Range Entry shall be discarded as padding." iovecs are used as if they are linearized, so it is incorrect to discard the rest of this iovec. Signed-off-by: Paolo Bonzini --- hw/ide/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 6f1938a..cb77dfc 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -374,7 +374,7 @@ BlockDriverAIOCB *ide_issue_trim(BlockDriverState *bs, uint16_t count = entry >> 48; if (count == 0) { - break; + continue; } ret = bdrv_discard(bs, sector, count); -- 1.8.1