summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-14 16:26:56 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-15 10:03:48 +0100
commit80bc2e8d807939bee89d1a5ca0dbe89946d39ed1 (patch)
treecc7b1eeef79885c5ebb32dccbc442048dfeff844
parent8238010b265886249f9f3d45e890788319b7736e (diff)
downloadqemu-80bc2e8d807939bee89d1a5ca0dbe89946d39ed1.tar.gz
ide: fix TRIM with empty range entry
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 <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--hw/ide/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 6f1938a0a8..cb77dfcd4e 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);