Skip to content

block: Lock the graph, part 2 (BlockDriver callbacks)

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23block: Make bdrv_can_set_read_only() staticblock.c include/block/block-io.h+2 -41 reply
2/23mirror: Fix access of uninitialised fields during startblock/mirror.c+7 -11 reply
3/23block: Mark bdrv_co_truncate() and callers GRAPH_RDLOCKblock/block-backend.c block/crypto.c block/io.c +8 more+44 -280 replies
4/23block: Mark bdrv_co_block_status() and callers GRAPH_RDLOCKblock/backup.c block/block-backend.c block/block-copy.c +11 more+81 -620 replies
5/23block: Mark bdrv_co_ioctl() and callers GRAPH_RDLOCKblock/block-backend.c block/io.c block/raw-format.c +2 more+11 -70 replies
6/23block/qed: add missing graph rdlock in qed_need_check_timer_entryblock/qed.c+3 -10 replies
7/23block: Mark bdrv_co_flush() and callers GRAPH_RDLOCKblock/blkdebug.c block/blklogwrites.c block/blkreplay.c +17 more+98 -600 replies
8/23block: Mark bdrv_co_pdiscard() and callers GRAPH_RDLOCKblock/blkdebug.c block/blklogwrites.c block/blkreplay.c +13 more+47 -370 replies
9/23block: Mark bdrv_co_pwrite_zeroes() and callers GRAPH_RDLOCKblock/blkdebug.c block/blklogwrites.c block/blkreplay.c +15 more+92 -690 replies
10/23block: Mark read/write in block/io.c GRAPH_RDLOCKblock/io.c block/parallels.c block/qcow.c +7 more+101 -1110 replies
11/23block: Mark public read/write functions GRAPH_RDLOCKblock/blkdebug.c block/blklogwrites.c block/blkreplay.c +28 more+233 -2380 replies
12/23block: Mark bdrv_co_pwrite_sync() and callers GRAPH_RDLOCKblock/io.c block/qcow2.h include/block/block-io.h+6 -60 replies
13/23block: Mark bdrv_co_do_pwrite_zeroes() GRAPH_RDLOCKblock/io.c+3 -40 replies
14/23block: Mark bdrv_co_copy_range() GRAPH_RDLOCKblock/block-backend.c block/file-posix.c block/io.c +7 more+66 -770 replies
15/23block: Mark preadv_snapshot/snapshot_block_status GRAPH_RDLOCKblock/copy-before-write.c block/io.c block/snapshot-access.c +2 more+17 -150 replies
16/23block: Mark bdrv_co_create() and callers GRAPH_RDLOCKblock.c block/create.c block/crypto.c +13 more+84 -900 replies
17/23block: Mark bdrv_co_io_(un)plug() and callers GRAPH_RDLOCKblock/block-backend.c block/io.c include/block/block-io.h +1 more+9 -40 replies
18/23block: Mark bdrv_co_is_inserted() and callers GRAPH_RDLOCKblock.c block/block-backend.c include/block/block-io.h +2 more+23 -170 replies
19/23block: Mark bdrv_co_eject/lock_medium() and callers GRAPH_RDLOCKblock.c block/block-backend.c block/copy-on-read.c +4 more+23 -100 replies
20/23block: Mark bdrv_(un)register_buf() GRAPH_RDLOCKblock/io.c include/block/block_int-common.h+14 -70 replies
21/23block: Mark bdrv_co_delete_file() and callers GRAPH_RDLOCKblock.c include/block/block-io.h include/block/block_int-common.h+9 -40 replies
22/23block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCKblock/dirty-bitmap.c include/block/block-io.h include/block/block_int-common.h +1 more+18 -160 replies
23/23block: Mark bdrv_co_refresh_total_sectors() and callers GRAPH_RDLOCKblock.c block/blkdebug.c block/blklogwrites.c +15 more+45 -230 replies

Reviews trailers per patch

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

PatchEmanuele Giuseppe EspositoVladimir Sementsov-OgievskiyStefan Hajnoczi
SeriesR-b A-b
1/23R-b
2/23R-b
3/23
4/23
5/23
6/23
7/23
8/23
9/23
10/23
11/23
12/23
13/23
14/23
15/23
16/23
17/23
18/23
19/23
20/23
21/23
22/23
23/23

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/23] block: Lock the graph, part 2 (BlockDriver callbacks)

After introducing the graph lock in a previous series, this series actually starts making widespread use of it.

Most of the BlockDriver callbacks access the children list in some way, so you need to hold the graph lock to call them. The patches in this series add the corresponding GRAPH_RDLOCK annotations and take the lock in places where it doesn't happen yet - all of the bdrv_*() co_wrappers are already covered, but in particular BlockBackend coroutine_fns still need it.

There is no particularly good reason why exactly these patches and not others are included in the series. I couldn't find a self-contained part that could reasonable be addressed in a single series. So these just happen to be patches that are somewhat related (centered around the BlockDriver callback theme), are ready and their number looks manageable. You will still see some FIXMEs at the end of the series that will only be addressed in future patches.

Emanuele Giuseppe Esposito (5):
block/qed: add missing graph rdlock in qed_need_check_timer_entry
block: Mark bdrv_co_flush() and callers GRAPH_RDLOCK
block: Mark bdrv_co_pdiscard() and callers GRAPH_RDLOCK
block: Mark bdrv_co_copy_range() GRAPH_RDLOCK
block: Mark bdrv_co_is_inserted() and callers GRAPH_RDLOCK

Kevin Wolf (18):
block: Make bdrv_can_set_read_only() static
mirror: Fix access of uninitialised fields during start
block: Mark bdrv_co_truncate() and callers GRAPH_RDLOCK
block: Mark bdrv_co_block_status() and callers GRAPH_RDLOCK
block: Mark bdrv_co_ioctl() and callers GRAPH_RDLOCK
block: Mark bdrv_co_pwrite_zeroes() and callers GRAPH_RDLOCK
block: Mark read/write in block/io.c GRAPH_RDLOCK
block: Mark public read/write functions GRAPH_RDLOCK
block: Mark bdrv_co_pwrite_sync() and callers GRAPH_RDLOCK
block: Mark bdrv_co_do_pwrite_zeroes() GRAPH_RDLOCK
block: Mark preadv_snapshot/snapshot_block_status GRAPH_RDLOCK
block: Mark bdrv_co_create() and callers GRAPH_RDLOCK
block: Mark bdrv_co_io_(un)plug() and callers GRAPH_RDLOCK
block: Mark bdrv_co_eject/lock_medium() and callers GRAPH_RDLOCK
block: Mark bdrv_(un)register_buf() GRAPH_RDLOCK
block: Mark bdrv_co_delete_file() and callers GRAPH_RDLOCK
block: Mark bdrv_*_dirty_bitmap() and callers GRAPH_RDLOCK
block: Mark bdrv_co_refresh_total_sectors() and callers GRAPH_RDLOCK

 block/coroutines.h                 |   2 +-
 block/qcow2.h                      |  27 +++--
 block/qed.h                        |  45 ++++----
 include/block/block-copy.h         |   6 +-
 include/block/block-global-state.h |  14 ++-
 include/block/block-io.h           | 110 +++++++++---------
 include/block/block_int-common.h   | 173 ++++++++++++++++-------------
 include/block/block_int-io.h       |  53 ++++-----
 include/block/dirty-bitmap.h       |  12 +-
 include/sysemu/block-backend-io.h  |   7 +-
 block.c                            |  12 +-
 block/backup.c                     |   3 +
 block/blkdebug.c                   |  19 ++--
 block/blklogwrites.c               |  35 +++---
 block/blkreplay.c                  |  24 ++--
 block/blkverify.c                  |   5 +-
 block/block-backend.c              |  39 +++++--
 block/block-copy.c                 |  32 +++---
 block/bochs.c                      |   2 +-
 block/commit.c                     |   5 +-
 block/copy-before-write.c          |  33 +++---
 block/copy-on-read.c               |  44 ++++----
 block/create.c                     |   9 +-
 block/crypto.c                     |  16 +--
 block/dirty-bitmap.c               |   2 +
 block/file-posix.c                 |  27 ++---
 block/file-win32.c                 |   7 +-
 block/filter-compress.c            |  36 +++---
 block/io.c                         | 108 +++++++++++-------
 block/iscsi.c                      |  28 ++---
 block/mirror.c                     |  59 ++++++----
 block/parallels.c                  |  33 +++---
 block/preallocate.c                |  38 ++++---
 block/qcow.c                       |  46 ++++----
 block/qcow2-cluster.c              |  17 ++-
 block/qcow2.c                      | 136 ++++++++++++-----------
 block/qed-check.c                  |   3 +-
 block/qed-table.c                  |  10 +-
 block/qed.c                        | 101 +++++++++--------
 block/quorum.c                     |  62 ++++++-----
 block/raw-format.c                 |  76 ++++++-------
 block/replication.c                |  18 ++-
 block/snapshot-access.c            |   8 +-
 block/stream.c                     |  40 ++++---
 block/throttle.c                   |  36 +++---
 block/vdi.c                        |  11 +-
 block/vhdx.c                       |  18 +--
 block/vmdk.c                       | 132 ++++++++++------------
 block/vpc.c                        |  11 +-
 qemu-img.c                         |   8 +-
 tests/unit/test-bdrv-drain.c       |  20 ++--
 tests/unit/test-block-iothread.c   |   3 +-
 52 files changed, 983 insertions(+), 838 deletions(-)
Signature · 1 line
2.38.1