mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
block/export: don't require AioContext lock around blk_exp_ref/unref()
The FUSE export calls blk_exp_ref/unref() without the AioContext lock. Instead of fixing the FUSE export, adjust blk_exp_ref/unref() so they work without the AioContext lock. This way it's less error-prone. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230516190238.8401-15-stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
195332c1d9
commit
3d499a43a2
3 changed files with 8 additions and 11 deletions
|
@ -44,9 +44,7 @@ static void vduse_blk_inflight_inc(VduseBlkExport *vblk_exp)
|
|||
{
|
||||
if (qatomic_fetch_inc(&vblk_exp->inflight) == 0) {
|
||||
/* Prevent export from being deleted */
|
||||
aio_context_acquire(vblk_exp->export.ctx);
|
||||
blk_exp_ref(&vblk_exp->export);
|
||||
aio_context_release(vblk_exp->export.ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,9 +55,7 @@ static void vduse_blk_inflight_dec(VduseBlkExport *vblk_exp)
|
|||
aio_wait_kick();
|
||||
|
||||
/* Now the export can be deleted */
|
||||
aio_context_acquire(vblk_exp->export.ctx);
|
||||
blk_exp_unref(&vblk_exp->export);
|
||||
aio_context_release(vblk_exp->export.ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue