qemu-e2k/block
Kevin Wolf 1dbc7d3442 stream: Fix AioContext locking during bdrv_graph_wrlock()
In stream_prepare(), we need to temporarily drop the AioContext lock
that job_prepare_locked() took for us while calling the graph write lock
functions which can poll.

All block nodes related to this block job are in the same AioContext, so
we can pass any of them to bdrv_graph_wrlock()/ bdrv_graph_wrunlock().
Unfortunately, the one that we picked is base, which can be NULL - and
in this case the AioContext lock is not released and deadlocks can
occur.

Fix this by passing s->target_bs, which is never NULL.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-ID: <20231115172012.112727-4-kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-11-21 12:45:21 +01:00
..
export block: Mark bdrv_first_blk() and bdrv_is_root_node() GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
monitor block: Mark bdrv_skip_implicit_filters() and callers GRAPH_RDLOCK 2023-11-07 19:14:19 +01:00
accounting.c
aio_task.c
amend.c
backup.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
blkdebug.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
blkio.c util/defer-call: move defer_call() to util/ 2023-10-31 15:41:42 +01:00
blklogwrites.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
blkreplay.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
blkverify.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
block-backend.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
block-copy.c block: Mark bdrv_chain_contains() and callers GRAPH_RDLOCK 2023-11-07 19:14:19 +01:00
block-gen.h
block-ram-registrar.c
bochs.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
cloop.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
commit.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
copy-before-write.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
copy-before-write.h
copy-on-read.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +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
create.c
crypto.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
crypto.h
curl.c block: Mark bdrv_apply_auto_read_only() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
dmg.h
file-posix.c file-posix: fix over-writing of returning zone_append offset 2023-11-06 16:15:07 +01:00
file-win32.c
filter-compress.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
gluster.c block: Mark bdrv_apply_auto_read_only() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
graph-lock.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
io_uring.c virtio: use defer_call() in virtio_irqfd_notify() 2023-10-31 15:42:14 +01:00
io.c block: Add missing GRAPH_RDLOCK annotations 2023-11-08 17:56:17 +01:00
iscsi-opts.c
iscsi.c block: Mark bdrv_apply_auto_read_only() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
linux-aio.c virtio: use defer_call() in virtio_irqfd_notify() 2023-10-31 15:42:14 +01:00
meson.build util/defer-call: move defer_call() to util/ 2023-10-31 15:41:42 +01:00
mirror.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
nbd.c block: Mark bdrv_apply_auto_read_only() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
nfs.c block: Mark bdrv_refresh_filename() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
null.c
nvme.c block/nvme: nvme_process_completion() fix bound for cid 2023-11-06 15:00:28 +00:00
parallels-ext.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
parallels.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +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
qapi-sysemu.c block: Fix locking in media change monitor commands 2023-10-31 13:51:28 +01:00
qapi.c block: Mark bdrv_refresh_filename() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
qcow2-bitmap.c qcow2: Take locks for accessing bs->file 2023-11-08 17:56:17 +01: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: Take locks for accessing bs->file 2023-11-08 17:56:17 +01:00
qcow2-refcount.c qcow2: Mark qcow2_signal_corruption() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
qcow2-snapshot.c
qcow2-threads.c
qcow2.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
qcow2.h qcow2: Take locks for accessing bs->file 2023-11-08 17:56:17 +01:00
qcow.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01: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: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
qed.h block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
quorum.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
raw-format.c block: Protect bs->file with graph_lock 2023-11-08 17:56:18 +01:00
rbd.c block: Mark bdrv_apply_auto_read_only() and callers GRAPH_RDLOCK 2023-10-12 16:31:33 +02:00
replication.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
reqlist.c
snapshot-access.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
snapshot.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
ssh.c aio: remove aio_disable_external() API 2023-05-30 17:37:26 +02:00
stream.c stream: Fix AioContext locking during bdrv_graph_wrlock() 2023-11-21 12:45:21 +01:00
throttle-groups.c block: mark mixed functions that can suspend 2023-09-26 18:09:08 +02: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
vdi.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
vhdx-endian.c
vhdx-log.c vhdx: Take locks for accessing bs->file 2023-11-08 17:56:18 +01:00
vhdx.c vhdx: Take locks for accessing bs->file 2023-11-08 17:56:18 +01:00
vhdx.h vhdx: Take locks for accessing bs->file 2023-11-08 17:56:18 +01:00
vmdk.c block: Fix deadlocks in bdrv_graph_wrunlock() 2023-11-21 12:45:21 +01:00
vpc.c block: Take graph lock for most of .bdrv_open 2023-11-08 17:56:18 +01:00
vvfat.c cpr: relax blockdev migration blockers 2023-11-01 16:13:59 +01:00
win32-aio.c aio: remove aio_disable_external() API 2023-05-30 17:37:26 +02:00
write-threshold.c