On Wed, Jan 31, 2024 at 06:31:40PM +0100, Kevin Wolf wrote: > blkio_alloc_mem_region() requires that the requested buffer size is a > multiple of the memory-alignment property. If it isn't, the allocation > fails with a return value of -EINVAL. > > Fix the call in blkio_resize_bounce_pool() to make sure the requested > size is properly aligned. > > I observed this problem with vhost-vdpa, which requires page aligned > memory. As the virtio-blk device behind it still had 512 byte blocks, we > got bs->bl.request_alignment = 512, but actually any request that needed > a bounce buffer and was not aligned to 4k would fail without this fix. > > Suggested-by: Stefano Garzarella <sgarz...@redhat.com> > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/blkio.c | 3 +++ > 1 file changed, 3 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
signature.asc
Description: PGP signature