On 12/13/22 11:53, Kevin Wolf wrote:
From: Emanuele Giuseppe Esposito <eespo...@redhat.com>

BlockDriver->bdrv_io_plug is categorized as IO callback, and it
currently doesn't run in a coroutine. We should let it take a graph
rdlock since the callback traverses the block nodes graph, which however
is only possible in a coroutine.

The only caller of this function is blk_io_plug(), therefore make
blk_io_plug() a co_wrapper, so that we're always running in a coroutine
where the lock can be taken.

Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
Signed-off-by: Kevin Wolf <kw...@redhat.com>
---

[..]

--- a/include/block/block_int-common.h
+++ b/include/block/block_int-common.h
@@ -729,7 +729,7 @@ struct BlockDriver {
      void (*bdrv_debug_event)(BlockDriverState *bs, BlkdebugEvent event);
/* io queue for linux-aio */
-    void (*bdrv_io_plug)(BlockDriverState *bs);
+    void coroutine_fn (*bdrv_io_plug)(BlockDriverState *bs);

don't we want to rename it to _co_ too?

anyway:
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>



--
Best regards,
Vladimir


Reply via email to