qemu/block
Stefan Hajnoczi a0b37625f6 block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF
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 <f.ebner@proxmox.com> 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: e8b6535533 ("block: add BDRV_REQ_REGISTERED_BUF request flag")
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
(cherry picked from commit 3c5867156e)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: zeng_chi <zengchi@kylinos.cn>
Message-Id: <20230207203719.242926-2-stefanha@redhat.com>
2023-11-27 17:58:28 +08:00
..
export New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
monitor New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
accounting.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
aio_task.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
amend.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
backup.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
blkdebug.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
blklogwrites.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
blkreplay.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
blkverify.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
block-backend.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
block-copy.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
block-gen.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
bochs.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
cloop.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
commit.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
copy-before-write.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
copy-before-write.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
copy-on-read.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
copy-on-read.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
coroutines.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
create.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
crypto.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
crypto.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
curl.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
dirty-bitmap.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
dmg-bz2.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
dmg-lzfse.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
dmg.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
dmg.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
file-posix.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
file-win32.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
filter-compress.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
gluster.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
io.c block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF 2023-11-27 17:58:28 +08:00
io_uring.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
iscsi-opts.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
iscsi.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
linux-aio.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
meson.build New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
mirror.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
nbd.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
nfs.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
null.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
nvme.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
parallels-ext.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
parallels.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
parallels.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
preallocate.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
progress_meter.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qapi-sysemu.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qapi.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-bitmap.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-cache.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-cluster.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-refcount.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-snapshot.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2-threads.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qcow2.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed-check.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed-cluster.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed-l2-cache.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed-table.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
qed.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
quorum.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
raw-format.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
rbd.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
replication.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
reqlist.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
snapshot-access.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
snapshot.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
ssh.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
stream.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
throttle-groups.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
throttle.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
trace-events New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
trace.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vdi.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vhdx-endian.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vhdx-log.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vhdx.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vhdx.h New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vmdk.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vpc.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
vvfat.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
win32-aio.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00
write-threshold.c New upstream version 7.1.0 2022-11-03 14:19:34 +08:00