Skip to content

block: Fix permissions after ro/rw reopen

Kevin Wolf qemu-devel 1 version Applied

Status from this message: Applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 20 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6qemu-io: Reset qemuio_blk permissions before each commandqemu-io.c tests/qemu-iotests/187.out+14 -16 replies
2/6block: Add reopen_queue to bdrv_child_perm()block.c block/commit.c block/mirror.c +3 more+23 -71 reply
3/6block: Add reopen queue to bdrv_check_perm()block.c+19 -151 reply
4/6block: Base permissions on rw state after reopenblock.c include/block/block.h+37 -161 reply
5/6block: reopen: Queue children after their parentsblock.c+13 -131 reply
6/6block: Fix permissions after bdrv_reopen()block.c include/block/block.h+65 -04 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchEric BlakeFam Zheng
1/6R-b R-b R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen

bdrv_reopen() can switch nodes between read-only and read-write modes. This has implications for the required permissions on their child nodes. For example, a qcow2 node requests write permissions on bs->file only if it is writable itself.

This means that during bdrv_reopen(), the permissions need to be recalculated in order to prevent failures where the bs->file permissions don't match its actual read-only state (e.g. bs->file is a read-write node, but the permission still enforces read-only access).

Kevin Wolf (6):
qemu-io: Reset qemuio_blk permissions before each command
block: Add reopen_queue to bdrv_child_perm()
block: Add reopen queue to bdrv_check_perm()
block: Base permissions on rw state after reopen
block: reopen: Queue children after their parents
block: Fix permissions after bdrv_reopen()

 include/block/block.h      |   2 +-
 include/block/block_int.h  |   7 ++
 block.c                    | 191 +++++++++++++++++++++++++++++++++------------
 block/commit.c             |   1 +
 block/mirror.c             |   1 +
 block/replication.c        |   1 +
 block/vvfat.c              |   1 +
 qemu-io.c                  |  13 +++
 tests/qemu-iotests/187.out |   2 +-
 9 files changed, 169 insertions(+), 50 deletions(-)
Signature · 1 line
2.13.5