Skip to content

Graph locking, part 3 (more block drivers)

Kevin Wolf qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest20 patches 5 repliesIn review
  2. v120 patches 52 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on current git master
- Improved some commit messages
- Patch 5: Added missing coroutine_fn annotations in test
- Patch 7: Updated comments, too

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20qcow2: Don't call bdrv_getlength() in coroutine_fnsblock/qcow2-refcount.c block/qcow2.c block/qcow2.h+13 -120 replies
2/20block: Consistently call bdrv_activate() outside coroutineblock/block-backend.c include/block/block-global-state.h+14 -20 replies
3/20block: bdrv/blk_co_unref() for calls in coroutine contextblock.c block/crypto.c block/parallels.c +9 more+44 -400 replies
4/20block: Don't call no_coroutine_fns in qmp_block_resize()blockdev.c+2 -21 reply
5/20test-bdrv-drain: Don't modify the graph in coroutinestests/unit/test-bdrv-drain.c+75 -370 replies
6/20graph-lock: Add GRAPH_UNLOCKED(_PTR)include/block/graph-lock.h+2 -00 replies
7/20graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lockinclude/block/graph-lock.h+8 -80 replies
8/20block: .bdrv_open is non-coroutine and unlockedblock.c block/qcow2.c block/qed.c +1 more+21 -260 replies
9/20nbd: Remove nbd_co_flush() wrapper functionblock/nbd.c+3 -80 replies
10/20nbd: Mark nbd_co_do_establish_connection() and callers GRAPH_RDLOCKblock/coroutines.h block/nbd.c+24 -200 replies
11/20vhdx: Require GRAPH_RDLOCK for accessing a node's parent listblock/vhdx.c+5 -40 replies
12/20mirror: Require GRAPH_RDLOCK for accessing a node's parent listblock/mirror.c+1 -12 replies
13/20block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCKblock.c block/vmdk.c include/block/block-io.h +1 more+10 -50 replies
14/20block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCKblock.c block/crypto.c block/io.c +4 more+22 -140 replies
15/20block: Mark bdrv_co_debug_event() GRAPH_RDLOCKblock.c include/block/block-io.h include/block/block_int-common.h+9 -60 replies
16/20block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCKblock/amend.c include/block/block_int-common.h+13 -70 replies
17/20block: Mark bdrv_query_bds_stats() and callers GRAPH_RDLOCKblock/qapi.c+4 -20 replies
18/20block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCKinclude/block/qapi.h qemu-img.c+6 -30 replies
19/20block: Mark bdrv_recurse_can_replace() and callers GRAPH_RDLOCKblock/blkverify.c block/mirror.c block/quorum.c +4 more+19 -100 replies
20/20block: Mark bdrv_refresh_limits() and callers GRAPH_RDLOCKblock.c block/io.c include/block/block-global-state.h +1 more+15 -30 replies

Reviews trailers per patch

All 20 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric BlakeStefan Hajnoczi
SeriesR-b
1/20R-b R-b
2/20R-b R-b
3/20R-b R-b
4/20R-b R-b
5/20R-b
6/20R-b R-b
7/20R-b
8/20R-b R-b
9/20R-b R-b
10/20R-b R-b
11/20R-b R-b
12/20R-b
13/20R-b
14/20R-b R-b
15/20R-b R-b
16/20R-b R-b
17/20R-b R-b
18/20R-b R-b
19/20R-b R-b
20/20R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/20] Graph locking, part 3 (more block drivers)

The first few patches in this series fix coroutine correctness problems that have existed for a while, but only actually start to make things fail in practice with stricter checks that we're going to introduce with the graph locking work.

The rest of the series makes sure that the graph lock is held in more block driver functions that access the children or parents list of a block node. This is incremental work and more patches are yet to come.

v2:
- Rebased on current git master
- Improved some commit messages
- Patch 5: Added missing coroutine_fn annotations in test
- Patch 7: Updated comments, too

I didn't remove the assertion in patch 13 yet which Stefan was questioning. I can remove it while applying if we decide that we really don't want it.

Emanuele Giuseppe Esposito (5):
nbd: Mark nbd_co_do_establish_connection() and callers GRAPH_RDLOCK
block: Mark bdrv_co_get_allocated_file_size() and callers GRAPH_RDLOCK
block: Mark bdrv_co_get_info() and callers GRAPH_RDLOCK
block: Mark bdrv_co_debug_event() GRAPH_RDLOCK
block: Mark BlockDriver callbacks for amend job GRAPH_RDLOCK

Kevin Wolf (15):
qcow2: Don't call bdrv_getlength() in coroutine_fns
block: Consistently call bdrv_activate() outside coroutine
block: bdrv/blk_co_unref() for calls in coroutine context
block: Don't call no_coroutine_fns in qmp_block_resize()
test-bdrv-drain: Don't modify the graph in coroutines
graph-lock: Add GRAPH_UNLOCKED(_PTR)
graph-lock: Fix GRAPH_RDLOCK_GUARD*() to be reader lock
block: .bdrv_open is non-coroutine and unlocked
nbd: Remove nbd_co_flush() wrapper function
vhdx: Require GRAPH_RDLOCK for accessing a node's parent list
mirror: Require GRAPH_RDLOCK for accessing a node's parent list
block: Mark bdrv_query_bds_stats() and callers GRAPH_RDLOCK
block: Mark bdrv_query_block_graph_info() and callers GRAPH_RDLOCK
block: Mark bdrv_recurse_can_replace() and callers GRAPH_RDLOCK
block: Mark bdrv_refresh_limits() and callers GRAPH_RDLOCK

 block/coroutines.h                          |   5 +-
 block/qcow2.h                               |   4 +-
 include/block/block-global-state.h          |  19 +++-
 include/block/block-io.h                    |  23 ++--
 include/block/block_int-common.h            |  37 +++----
 include/block/block_int-global-state.h      |   4 +-
 include/block/graph-lock.h                  |  18 ++--
 include/block/qapi.h                        |   7 +-
 include/sysemu/block-backend-global-state.h |   5 +-
 block.c                                     |  25 ++++-
 block/amend.c                               |   8 +-
 block/blkverify.c                           |   5 +-
 block/block-backend.c                       |  10 +-
 block/crypto.c                              |   8 +-
 block/io.c                                  |  12 +--
 block/mirror.c                              |  14 ++-
 block/nbd.c                                 |  50 +++++----
 block/parallels.c                           |   6 +-
 block/qapi.c                                |   6 +-
 block/qcow.c                                |   6 +-
 block/qcow2-refcount.c                      |   2 +-
 block/qcow2.c                               |  48 ++++-----
 block/qed.c                                 |  24 ++---
 block/quorum.c                              |   4 +-
 block/raw-format.c                          |   2 +-
 block/vdi.c                                 |   6 +-
 block/vhdx.c                                |  15 +--
 block/vmdk.c                                |  20 ++--
 block/vpc.c                                 |   6 +-
 blockdev.c                                  |   7 +-
 qemu-img.c                                  |   2 +
 tests/unit/test-bdrv-drain.c                | 112 +++++++++++++-------
 32 files changed, 310 insertions(+), 210 deletions(-)
Signature · 1 line
2.40.1