qemu/block
Jean-Louis Dupond cc9f53b3ec qcow2: keep reference on zeroize with discard-no-unref enabled
When the discard-no-unref flag is enabled, we keep the reference for
normal discard requests.
But when a discard is executed on a snapshot/qcow2 image with backing,
the discards are saved as zero clusters in the snapshot image.

When committing the snapshot to the backing file, not
discard_in_l2_slice is called but zero_in_l2_slice. Which did not had
any logic to keep the reference when discard-no-unref is enabled.

Therefor we add logic in the zero_in_l2_slice call to keep the reference
on commit.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1621
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Message-Id: <20231003125236.216473-2-jean-louis@dupond.be>
[hreitz: Made the documentation change more verbose, as discussed
         on-list]
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
(cherry picked from commit b2b109041ecd1095384f5be5bb9badd13c1cf286)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-11-09 16:39:13 +03:00
..
export vhost-user: fully use new backend/frontend naming 2023-06-26 09:50:00 -04:00
monitor meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
accounting.c
aio_task.c
amend.c
backup.c
blkdebug.c
blkio.c block/blkio: add more comments on the fd passing handling 2023-08-03 11:28:43 -04:00
blklogwrites.c
blkreplay.c
blkverify.c
block-backend.c
block-copy.c
block-gen.h
block-ram-registrar.c
bochs.c bochs: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:24 +02:00
cloop.c cloop: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:27 +02:00
commit.c
copy-before-write.c
copy-before-write.h
copy-on-read.c
copy-on-read.h
coroutines.h
create.c
crypto.c
crypto.h
curl.c
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c dmg: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:28 +02:00
dmg.h
file-posix.c file-posix: Simplify raw_co_prw's 'out' zone code 2023-10-03 02:00:54 +03:00
file-win32.c
filter-compress.c
gluster.c
graph-lock.c Revert "graph-lock: Disable locking for now" 2023-06-28 08:46:26 +02:00
io.c block: Fix pad_request's request restriction 2023-07-27 09:48:16 -04:00
io_uring.c
iscsi-opts.c
iscsi.c
linux-aio.c
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
mirror.c
nbd.c nbd/client: Simplify cookie vs. index computation 2023-07-19 15:26:13 -05:00
nfs.c
null.c
nvme.c block/nvme: nvme_process_completion() fix bound for cid 2023-11-09 16:39:13 +03:00
parallels-ext.c util/uuid: Add UUID_STR_LEN definition 2023-11-09 16:39:13 +03:00
parallels.c block: use bdrv_co_getlength in coroutine context 2023-06-28 09:46:33 +02:00
parallels.h
plug.c
preallocate.c
progress_meter.c
qapi-sysemu.c block: Fix locking in media change monitor commands 2023-11-01 12:51:23 +03:00
qapi.c
qcow.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qcow2-bitmap.c qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:32 +02:00
qcow2-cache.c
qcow2-cluster.c qcow2: keep reference on zeroize with discard-no-unref enabled 2023-11-09 16:39:13 +03:00
qcow2-refcount.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qcow2-snapshot.c
qcow2-threads.c
qcow2.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qcow2.h qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:32 +02:00
qed-check.c qed: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:20 +02:00
qed-cluster.c
qed-l2-cache.c
qed-table.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qed.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qed.h
quorum.c
raw-format.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
rbd.c
replication.c
reqlist.c
snapshot-access.c
snapshot.c
ssh.c
stream.c
throttle-groups.c
throttle.c
trace-events
trace.h
vdi.c util/uuid: Add UUID_STR_LEN definition 2023-11-09 16:39:13 +03:00
vhdx-endian.c
vhdx-log.c vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:30 +02:00
vhdx.c vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:30 +02:00
vhdx.h vhdx: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:30 +02:00
vmdk.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
vpc.c vpc: mark more functions as coroutine_fns and GRAPH_RDLOCK 2023-06-28 09:46:23 +02:00
vvfat.c
win32-aio.c
write-threshold.c