[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/11] block: Fix AioContext locking in bdrv_open_inherit()
From: |
Eric Blake |
Subject: |
Re: [PATCH 07/11] block: Fix AioContext locking in bdrv_open_inherit() |
Date: |
Wed, 31 May 2023 15:01:47 -0500 |
User-agent: |
NeoMutt/20230517 |
On Wed, May 31, 2023 at 01:02:27PM +0200, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Commit message is sparse, and doesn't mention....
> ---
> block.c | 25 ++++++++++++++++++++++++-
> 1 file changed, 24 insertions(+), 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index a0793b6435..954b9923d9 100644
> --- a/block.c
> +++ b/block.c
> @@ -3794,6 +3794,7 @@ static BlockDriverState
> *bdrv_append_temp_snapshot(BlockDriverState *bs,
> int64_t total_size;
> QemuOpts *opts = NULL;
> BlockDriverState *bs_snapshot = NULL;
> + AioContext *ctx = bdrv_get_aio_context(bs);
> int ret;
>
> GLOBAL_STATE_CODE();
> @@ -3802,7 +3803,10 @@ static BlockDriverState
> *bdrv_append_temp_snapshot(BlockDriverState *bs,
> instead of opening 'filename' directly */
>
> /* Get the required size from the image */
> + aio_context_acquire(ctx);
> total_size = bdrv_getlength(bs);
> + aio_context_release(ctx);
> +
> if (total_size < 0) {
> error_setg_errno(errp, -total_size, "Could not get image size");
> goto out;
> @@ -3836,7 +3840,10 @@ static BlockDriverState
> *bdrv_append_temp_snapshot(BlockDriverState *bs,
> goto out;
> }
>
> + aio_context_acquire(ctx);
> ret = bdrv_append(bs_snapshot, bs, errp);
> + aio_context_release(ctx);
> +
> if (ret < 0) {
> bs_snapshot = NULL;
> goto out;
...the changes to bdrv_append_temp_snapshot above.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH 02/11] qdev-properties-system: Lock AioContext for blk_insert_bs(), (continued)
- [PATCH 02/11] qdev-properties-system: Lock AioContext for blk_insert_bs(), Kevin Wolf, 2023/05/31
- [PATCH 03/11] test-block-iothread: Lock AioContext for blk_insert_bs(), Kevin Wolf, 2023/05/31
- [PATCH 05/11] block: Fix AioContext locking in bdrv_attach_child_common(), Kevin Wolf, 2023/05/31
- [PATCH 10/11] graph-lock: Unlock the AioContext while polling, Kevin Wolf, 2023/05/31
- [PATCH 01/11] iotests: Test active commit with iothread and background I/O, Kevin Wolf, 2023/05/31
- [PATCH 06/11] block: Fix AioContext locking in bdrv_reopen_parse_file_or_backing(), Kevin Wolf, 2023/05/31
- [PATCH 11/11] Revert "graph-lock: Disable locking for now", Kevin Wolf, 2023/05/31
- [PATCH 08/11] block: Fix AioContext locking in bdrv_open_backing_file(), Kevin Wolf, 2023/05/31
- [PATCH 04/11] block: Fix AioContext locking in bdrv_open_child(), Kevin Wolf, 2023/05/31
- [PATCH 07/11] block: Fix AioContext locking in bdrv_open_inherit(), Kevin Wolf, 2023/05/31
- Re: [PATCH 07/11] block: Fix AioContext locking in bdrv_open_inherit(),
Eric Blake <=