xen_disk: split discard input to match internal representation
The guest sends discard requests as u64 sector/count pairs, but the block layer operates internally with s64/s32 pairs. The conversion leads to IO errors in the guest, the discard request is not processed. domU.cfg: 'vdev=xvda, format=qcow2, backendtype=qdisk, target=/x.qcow2' domU: mkfs.ext4 -F /dev/xvda Discarding device blocks: failed - Input/output error Fix this by splitting the request into chunks of BDRV_REQUEST_MAX_SECTORS. Add input range checking to avoid overflow. Fixes f3135204 ("xen_disk: add discard support") Signed-off-by: NOlaf Hering <olaf@aepfle.de> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NStefano Stabellini <sstabellini@kernel.org>
Showing
想要评论请 注册 或 登录