From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9h3-0002KF-Md for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:49:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv9h0-0005YC-Tv for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9h0-0005Y3-Ml for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:48:54 -0500 From: Stefan Hajnoczi Date: Tue, 15 Jan 2013 17:48:23 +0100 Message-Id: <1358268511-27061-8-git-send-email-stefanha@redhat.com> In-Reply-To: <1358268511-27061-1-git-send-email-stefanha@redhat.com> References: <1358268511-27061-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 07/15] 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: Paolo Bonzini , Anthony Liguori , Stefan Hajnoczi From: Paolo Bonzini 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 Signed-off-by: Stefan Hajnoczi --- 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.0.2