qemu-e2k/block
Emanuele Giuseppe Esposito dae84929e4 crypto: distinguish between main loop and I/O in block_crypto_amend_options_generic_luks
block_crypto_amend_options_generic_luks uses the block layer
permission API, therefore it should be called with the BQL held.

However, the same function is being called by two BlockDriver
callbacks: bdrv_amend_options (under BQL) and bdrv_co_amend (I/O).

The latter is I/O because it is invoked by block/amend.c's
blockdev_amend_run(), a .run callback of the amend JobDriver.

Therefore we want to change this function to still perform
the permission check, but making sure it is done under BQL regardless
of the caller context.

Remove the permission check in block_crypto_amend_options_generic_luks()
and:
- in block_crypto_amend_options_luks() (BQL case, called by
  .bdrv_amend_options()), reuse helper functions
  block_crypto_amend_{prepare/cleanup} that take care of checking
  permissions.

- for block_crypto_co_amend_luks() (I/O case, called by
  .bdrv_co_amend()), don't check for permissions but delegate
  .bdrv_amend_pre_run() and .bdrv_amend_clean() to do it,
  performing these checks before and after the job runs in its aiocontext.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220209105452.1694545-3-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-03-04 18:14:40 +01:00
..
export block/export/fuse: Fix build failure on FreeBSD 2022-02-01 13:49:15 +01:00
monitor include/sysemu/blockdev.h: remove drive_mark_claimed_by_board and inline drive_def 2022-01-14 12:03:16 +01:00
accounting.c
aio_task.c block/aio_task: assert max_busy_tasks is greater than 0 2021-10-05 18:56:41 +02:00
amend.c crypto: perform permission checks under BQL 2022-03-04 18:14:39 +01:00
backup.c jobs: Give Job.force_cancel more meaning 2021-10-07 10:42:34 +02:00
blkdebug.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
blklogwrites.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
blkreplay.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
blkverify.c block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
block-backend.c block-backend: Retain permissions after migration 2022-02-01 10:51:39 +01:00
block-copy.c block/block-copy: block_copy_state_new(): drop extra arguments 2021-09-01 14:38:08 +02:00
block-gen.h
bochs.c block: use int64_t instead of uint64_t in driver read handlers 2021-09-29 13:46:31 -05:00
cloop.c block: use int64_t instead of uint64_t in driver read handlers 2021-09-29 13:46:31 -05:00
commit.c block: drop BLK_PERM_GRAPH_MOD 2022-01-14 12:03:16 +01:00
copy-before-write.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
copy-before-write.h block/copy-before-write: bdrv_cbw_append(): drop unused compress arg 2021-09-01 14:03:47 +02:00
copy-on-read.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
copy-on-read.h
coroutines.h block-backend: drop blk_prw, use block-coroutine-wrapper 2021-10-15 15:53:24 -05:00
create.c
crypto.c crypto: distinguish between main loop and I/O in block_crypto_amend_options_generic_luks 2022-03-04 18:14:40 +01:00
crypto.h
curl.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
dirty-bitmap.c iotests: Improve and rename test 291 to qemu-img-bitmap 2021-07-21 14:14:41 -05:00
dmg-bz2.c
dmg-lzfse.c
dmg.c block: use int64_t instead of uint64_t in driver read handlers 2021-09-29 13:46:31 -05:00
dmg.h
file-posix.c block/file-posix: Simplify the XFS_IOC_DIOINFO handling 2022-01-12 14:09:04 +01:00
file-win32.c block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
filter-compress.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
gluster.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
io_uring.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
io.c block/io: Update BSC only if want_zero is true 2022-01-28 16:52:40 -06:00
iscsi-opts.c modules: add block module annotations 2021-07-09 18:20:27 +02:00
iscsi.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
linux-aio.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
meson.build configure, meson: move block layer options to meson_options.txt 2022-02-21 10:35:53 +01:00
mirror.c block: drop BLK_PERM_GRAPH_MOD 2022-01-14 12:03:16 +01:00
nbd.c block/nbd: Move s->ioc on AioContext change 2022-02-11 14:06:15 +01:00
nfs.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
null.c block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
nvme.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
parallels-ext.c
parallels.c
parallels.h
preallocate.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
progress_meter.c
qapi-sysemu.c
qapi.c
qcow2-bitmap.c
qcow2-cache.c
qcow2-cluster.c qcow2: Silence clang -m32 compiler warning 2021-10-15 15:39:38 -05:00
qcow2-refcount.c qcow2-refcount: check_refblocks(): add separate message for reserved 2021-09-15 18:42:38 +02:00
qcow2-snapshot.c
qcow2-threads.c
qcow2.c qcow2: simple case support for downgrading of qcow2 images with zstd 2022-02-01 10:51:39 +01:00
qcow2.h qcow2-refcount: check_refblocks(): add separate message for reserved 2021-09-15 18:42:38 +02:00
qcow.c block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c block: use int64_t instead of int in driver write_zeroes handlers 2021-09-29 13:46:32 -05:00
qed.h
quorum.c block: use int64_t instead of int in driver write_zeroes handlers 2021-09-29 13:46:32 -05:00
raw-format.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
rbd.c block/rbd: workaround for ceph issue #53784 2022-02-01 15:16:32 +01:00
replication.c job: @force parameter for job_cancel_sync() 2021-10-07 10:42:09 +02:00
snapshot.c
ssh.c block: print the server key type and fingerprint on failure 2022-02-16 14:34:16 +00:00
stream.c block/stream: add own blk 2021-12-28 15:18:54 +01:00
throttle-groups.c
throttle.c block: use int64_t instead of int in driver discard handlers 2021-09-29 13:46:32 -05:00
trace-events block/nvme: Display CQ/SQ pointer in nvme_free_queue_pair() 2021-11-02 15:49:12 +01:00
trace.h
vdi.c block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
vhdx-endian.c
vhdx-log.c
vhdx.c
vhdx.h
vmdk.c vmdk: allow specification of tools version 2021-11-02 12:47:51 +01:00
vpc.c block/vpc: Add a sanity check that fixed-size images have the right type 2021-11-02 12:47:51 +01:00
vvfat.c vvfat: Fix vvfat_write() for writes before the root directory 2022-01-14 12:03:16 +01:00
win32-aio.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
write-threshold.c