[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref(
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref() |
Date: |
Mon, 3 Apr 2023 14:30:02 -0400 |
These functions must be called with the AioContext acquired:
/* Callers must hold exp->ctx lock */
void blk_exp_ref(BlockExport *exp)
...
/* Callers must hold exp->ctx lock */
void blk_exp_unref(BlockExport *exp)
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/export/fuse.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/export/fuse.c b/block/export/fuse.c
index 06fa41079e..18394f9e07 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -244,7 +244,9 @@ static void read_from_fuse_export(void *opaque)
FuseExport *exp = opaque;
int ret;
+ aio_context_acquire(exp->common.ctx);
blk_exp_ref(&exp->common);
+ aio_context_release(exp->common.ctx);
do {
ret = fuse_session_receive_buf(exp->fuse_session, &exp->fuse_buf);
@@ -256,7 +258,9 @@ static void read_from_fuse_export(void *opaque)
fuse_session_process_buf(exp->fuse_session, &exp->fuse_buf);
out:
+ aio_context_acquire(exp->common.ctx);
blk_exp_unref(&exp->common);
+ aio_context_release(exp->common.ctx);
}
static void fuse_export_shutdown(BlockExport *blk_exp)
--
2.39.2
- Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event, (continued)
Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event, Michael S. Tsirkin, 2023/04/04
[PATCH 09/13] hw/xen: do not set is_external=true on evtchn fds, Stefan Hajnoczi, 2023/04/03
[PATCH 07/13] virtio: do not set is_external=true on host notifiers, Stefan Hajnoczi, 2023/04/03
[PATCH 12/13] block/fuse: do not set is_external=true on FUSE fd, Stefan Hajnoczi, 2023/04/03
[PATCH 10/13] block/export: rewrite vduse-blk drain code, Stefan Hajnoczi, 2023/04/03
[PATCH 13/13] aio: remove aio_disable_external() API, Stefan Hajnoczi, 2023/04/03
[PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref(),
Stefan Hajnoczi <=
Re: [PATCH 00/13] block: remove aio_disable_external() API, Paolo Bonzini, 2023/04/04