qemu/block
Denis V. Lunev f48fe4de00 qcow2: do not try to clear the dirty bit on a read-only node
qcow2_do_close() -> qcow2_inactivate() clears the dirty bit with a
plain write to bs->file, unconditionally. A read-only node can still
be dirty, inherited from an earlier writable session, and that write
then hits a missing BLK_PERM_WRITE and asserts in
bdrv_co_write_req_prepare() (block/io.c) on an entirely ordinary
close -- closing is expected, the dirty bit on a read-only node
is not.

Skip the clear for read-only nodes, same as read access already does.
Any other still-dirty node keeps the unguarded write: it is expected
to hold write permission, and a missing one there is a bug worth
seeing.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Hanna Reitz <hreitz@redhat.com>
Message-ID: <20260716153552.3376009-1-den@openvz.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit fe0f9e3ab2)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-08-05 10:52:02 +03:00
..
export block: Add flags parameter to blk_*_pdiscard() 2026-05-20 11:22:56 +03:00
monitor nbd/server: Allow users to adjust handshake limit in QMP 2025-02-11 13:45:47 -06:00
accounting.c block/qapi: take stats->lock when reading BlockAcctStats for query-blockstats 2026-08-05 10:52:02 +03:00
aio_task.c block: Remove unused aio_task_pool_empty 2024-09-30 10:53:18 +03:00
amend.c block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK 2023-05-10 14:16:54 +02:00
backup.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
blkdebug.c blkdebug: Add 'delay-ns' option 2026-05-20 11:22:56 +03:00
blkio.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
blklogwrites.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
blkreplay.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
blkverify.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
block-backend.c block: Add flags parameter to blk_*_pdiscard() 2026-05-20 11:22:56 +03:00
block-copy.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
block-gen.h block-coroutine-wrapper.py: support also basic return types 2022-12-15 16:07:43 +01:00
block-ram-registrar.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
bochs.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
cloop.c block/cloop: fix integer overflow in total_sectors calculation 2026-08-05 10:52:02 +03:00
commit.c block: allow commit to unmap zero blocks 2025-11-21 16:01:47 +03:00
copy-before-write.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
copy-before-write.h backup: add minimum cluster size to performance options 2024-09-30 10:53:08 +03:00
copy-on-read.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
copy-on-read.h block: Mark bdrv_(un)freeze_backing_chain() and callers GRAPH_RDLOCK 2023-11-07 19:14:19 +01:00
coroutines.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
create.c qemu/compiler: Absorb 'clang-tsa.h' 2025-03-06 14:21:25 +01:00
crypto.c block: fix luks 'amend' when run in coroutine 2025-11-14 14:28:58 +03:00
crypto.h block: Support detached LUKS header creation using qemu-img 2024-02-09 12:50:37 +00:00
curl.c block/curl: free s->password in cleanup paths 2026-03-31 20:07:01 +03:00
dirty-bitmap.c block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCK 2023-02-23 19:49:32 +01:00
dmg-bz2.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
dmg-lzfse.c block/dmg: Ignore C99 prototype declaration mismatch from <lzfse.h> 2023-03-30 15:03:36 +02:00
dmg.c dmg: reject inconsistent UDRW chunk sector count and length (CVE-2026-65928) 2026-08-05 10:52:02 +03:00
dmg.h block/dmg: Declare a type definition for DMG uncompress function 2023-04-24 13:53:44 -04:00
file-posix.c file-posix: Fix aio=threads performance regression after enablign FUA 2025-07-17 06:57:23 +03:00
file-win32.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
filter-compress.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
gluster.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
graph-lock.c block/graph-lock: fix missed wakeup in bdrv_graph_co_rdunlock() 2026-05-25 20:10:28 +03:00
io.c block/io: fallback to bounce buffer if BLKZEROOUT is not supported because of alignment 2026-06-08 20:27:51 +03:00
io_uring.c block/io_uring: avoid potentially getting stuck after resubmit at the end of ioq_submit() 2025-11-26 17:05:59 +03:00
iscsi-opts.c modules: add block module annotations 2021-07-09 18:20:27 +02:00
iscsi.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
linux-aio.c block/linux-aio: bound ioq_submit() recursion depth 2026-05-30 09:57:25 +03:00
meson.build include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
mirror.c block: Add flags parameter to blk_*_pdiscard() 2026-05-20 11:22:56 +03:00
nbd.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
nfs.c block/nfs: Do not enter coroutine from CB 2026-03-11 16:39:16 +03:00
null.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
nvme.c Revert "nvme: Fix coroutine waking" 2026-01-07 16:31:43 +03:00
parallels-ext.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 2024-09-10 14:02:16 +02:00
parallels.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
parallels.h block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
preallocate.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
progress_meter.c coroutine: Clean up superfluous inclusion of qemu/lockable.h 2023-01-19 10:18:28 +01:00
qapi-system.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qapi.c block/qapi: take stats->lock when reading BlockAcctStats for query-blockstats 2026-08-05 10:52:02 +03:00
qcow.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
qcow2-bitmap.c block/qcow2-bitmap: Replace g_memdup() by g_memdup2() 2024-05-08 19:11:34 +02:00
qcow2-cache.c qcow2: Mark qcow2_signal_corruption() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
qcow2-cluster.c qcow2: Fix data loss on zero write with detect-zeroes=unmap 2026-06-11 06:50:26 +03:00
qcow2-refcount.c qcow2: Mark qcow2_signal_corruption() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
qcow2-snapshot.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
qcow2-threads.c thread-pool: avoid passing the pool parameter every time 2023-04-25 13:17:28 +02:00
qcow2.c qcow2: do not try to clear the dirty bit on a read-only node 2026-08-05 10:52:02 +03:00
qcow2.h qcow2: Fix data loss on zero write with detect-zeroes=unmap 2026-06-11 06:50:26 +03: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: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
qed-l2-cache.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
qed-table.c block: use bdrv_co_debug_event in coroutine context 2023-06-28 09:46:34 +02:00
qed.c qed: Don't try to flush during incoming migration 2026-06-11 06:58:40 +03:00
qed.h block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
quorum.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
raw-format.c raw-format: Fix error message for invalid offset/size 2024-10-22 17:52:49 +02:00
rbd.c rbd: Run co BH CB in the coroutine’s AioContext 2025-11-21 16:01:47 +03:00
replication.c Block layer patches 2025-02-10 13:25:36 -05:00
reqlist.c block/reqlist: allow adding overlapping requests 2024-09-30 10:53:18 +03:00
snapshot-access.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
snapshot.c block: Zero block driver state before reopening 2025-03-11 15:49:14 +01:00
ssh.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
stream.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
throttle-groups.c throttle-group: Fix race condition in throttle_group_restart_queue() 2026-03-24 09:16:24 +03:00
throttle.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
trace-events nbd/client: Accept 64-bit block status chunks 2023-10-05 11:02:08 -05:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vdi.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
vhdx-endian.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
vhdx-log.c vhdx: Take locks for accessing bs->file 2023-11-08 17:56:18 +01:00
vhdx.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
vhdx.h vhdx: Take locks for accessing bs->file 2023-11-08 17:56:18 +01:00
vmdk.c block/vmdk: fix OOB read in vmdk_read_extent() 2026-03-11 16:39:16 +03:00
vpc.c Block layer patches 2025-02-10 13:25:36 -05:00
vvfat.c Fix const qualifier build errors with recent glibc 2026-01-07 16:31:43 +03:00
win32-aio.c aio: remove aio_disable_external() API 2023-05-30 17:37:26 +02:00
write-threshold.c block: remove AioContext locking 2023-12-21 22:49:27 +01:00