[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/7] ide: fix TRIM with empty range entry
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 5/7] ide: fix TRIM with empty range entry |
Date: |
Mon, 14 Jan 2013 16:26:56 +0100 |
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 <address@hidden>
---
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
- [Qemu-devel] [PATCH resend 0/7] Discard improvements, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 1/7] raw-posix: support discard on more filesystems, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 2/7] raw-posix: remember whether discard failed, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 3/7] raw: support discard on block devices, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 4/7] block: make discard asynchronous, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 5/7] ide: fix TRIM with empty range entry,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 6/7] ide: issue discard asynchronously but serialize the pieces, Paolo Bonzini, 2013/01/14
- [Qemu-devel] [PATCH 7/7] block: clear dirty bitmap when discarding, Paolo Bonzini, 2013/01/14
- Re: [Qemu-devel] [PATCH resend 0/7] Discard improvements, Stefan Hajnoczi, 2013/01/15