diff mbox series

[v2,01/11] block.c: assert bs->aio_context is written under BQL and drains

Message ID 20220725122120.309236-2-eesposit@redhat.com (mailing list archive)
State New, archived
Headers show
Series Refactor bdrv_try_set_aio_context using transactions | expand

Commit Message

Emanuele Giuseppe Esposito July 25, 2022, 12:21 p.m. UTC
Also here ->aio_context is read by I/O threads and written
under BQL.

Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
 block.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kevin Wolf Oct. 7, 2022, 2:42 p.m. UTC | #1
Am 25.07.2022 um 14:21 hat Emanuele Giuseppe Esposito geschrieben:
> Also here ->aio_context is read by I/O threads and written
> under BQL.
> 
> Reviewed-by: Hanna Reitz <hreitz@redhat.com>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
diff mbox series

Patch

diff --git a/block.c b/block.c
index 7559965dbc..58a9cfc8b7 100644
--- a/block.c
+++ b/block.c
@@ -7282,6 +7282,7 @@  static void bdrv_detach_aio_context(BlockDriverState *bs)
     if (bs->quiesce_counter) {
         aio_enable_external(bs->aio_context);
     }
+    assert_bdrv_graph_writable(bs);
     bs->aio_context = NULL;
 }
 
@@ -7295,6 +7296,7 @@  static void bdrv_attach_aio_context(BlockDriverState *bs,
         aio_disable_external(new_context);
     }
 
+    assert_bdrv_graph_writable(bs);
     bs->aio_context = new_context;
 
     if (bs->drv && bs->drv->bdrv_attach_aio_context) {