Skip to content

Protect the block layer with a rwlock: part 2

Emanuele Giuseppe Esposito qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6block: assert that bdrv_co_create is always called with graph rdlock takenblock.c include/block/block_int-common.h+2 -00 replies
2/6block: assert that BlockDriver->bdrv_co_{amend/create} are called with graph rdlock takenblock/amend.c block/create.c include/block/block_int-common.h+4 -00 replies
3/6block: assert that BlockDriver->bdrv_co_copy_range_{from/to} is always called with graph rdlock takenblock/block-backend.c block/io.c include/block/block_int-common.h +1 more+14 -10 replies
4/6block/dirty-bitmap: assert that BlockDriver->bdrv_co_*_dirty_bitmap are always called with graph rdlock takenblock/dirty-bitmap.c include/block/block_int-common.h+4 -00 replies
5/6block/io: assert that BlockDriver->bdrv_co_*_snapshot_* are always called with graph rdlock takenblock/io.c include/block/block_int-common.h+5 -00 replies
6/6block: assert that BlockDriver->bdrv_co_delete_file is always called with graph rdlock takenblock.c include/block/block_int-common.h+2 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] Protect the block layer with a rwlock: part 2

Please read "Protect the block layer with a rwlock: part 1" for an additional introduction and aim of this series.

This second part aims to add the graph rdlock to the BlockDriver functions that already run in coroutine context and are classified as IO. Such functions will recursively traverse the BlockDriverState graph, therefore they need to be protected with the rdlock.

Based-on: <[email protected]>

Thank you,
Emanuele

Emanuele Giuseppe Esposito (6):
block: assert that bdrv_co_create is always called with graph rdlock
taken
block: assert that BlockDriver->bdrv_co_{amend/create} are called with
graph rdlock taken
block: assert that BlockDriver->bdrv_co_copy_range_{from/to} is always
called with graph rdlock taken
block/dirty-bitmap: assert that BlockDriver->bdrv_co_*_dirty_bitmap
are always called with graph rdlock taken
block/io: assert that BlockDriver->bdrv_co_*_snapshot_* are always
called with graph rdlock taken
block: assert that BlockDriver->bdrv_co_delete_file is always called
with graph rdlock taken

 block.c                          |  2 ++
 block/amend.c                    |  1 +
 block/block-backend.c            |  2 ++
 block/create.c                   |  1 +
 block/dirty-bitmap.c             |  2 ++
 block/io.c                       |  7 +++++++
 include/block/block_int-common.h | 14 +++++++++++++-
 qemu-img.c                       |  4 +++-
 8 files changed, 31 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1