On Mon, Jan 30, 2023 at 04:54:12PM -0500, Stefan Hajnoczi wrote:
> When a write request is converted into a write zeroes request by the
> detect-zeroes= feature, it is no longer associated with an I/O buffer.
> The BDRV_REQ_REGISTERED_BUF flag doesn't make sense without an I/O
> buffer and must be cleared because bdrv_co_do_pwrite_zeroes() fails with
> -EINVAL when it's set.
> 
> Fiona Ebner <[email protected]> bisected and diagnosed this QEMU 7.2
> regression where writes containing zeroes to a blockdev with
> discard=unmap,detect-zeroes=unmap fail.
> 
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/1404
> Fixes: e8b6535533be ("block: add BDRV_REQ_REGISTERED_BUF request flag")
> Tested-by: Fiona Ebner <[email protected]>
> Cc: [email protected]
> Signed-off-by: Stefan Hajnoczi <[email protected]>
> ---
>  block/io.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Eric Blake <[email protected]>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


Reply via email to