提交 80bc2e8d 编写于 作者: P Paolo Bonzini 提交者: Stefan Hajnoczi

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: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 8238010b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册