qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: remove bs from lists before closing
@ 2019-05-07  8:12 Anton Kuchin
  2019-05-07  8:53 ` Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Kuchin @ 2019-05-07  8:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Anton Kuchin, yc-core, qemu-block, Max Reitz

Close involves flush that can be performed asynchronously and bs
must be protected from being referenced before it is deleted.

Signed-off-by: Anton Kuchin <antonkuchin@yandex-team.ru>
---
 block.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index 9ae5c0ed2f..b505271a4d 100644
--- a/block.c
+++ b/block.c
@@ -4083,14 +4083,14 @@ static void bdrv_delete(BlockDriverState *bs)
     assert(bdrv_op_blocker_is_empty(bs));
     assert(!bs->refcnt);
 
-    bdrv_close(bs);
-
     /* remove from list, if necessary */
     if (bs->node_name[0] != '\0') {
         QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list);
     }
     QTAILQ_REMOVE(&all_bdrv_states, bs, bs_list);
 
+    bdrv_close(bs);
+
     g_free(bs);
 }
 
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] block: remove bs from lists before closing
  2019-05-07  8:12 [Qemu-devel] [PATCH] block: remove bs from lists before closing Anton Kuchin
@ 2019-05-07  8:53 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2019-05-07  8:53 UTC (permalink / raw)
  To: Anton Kuchin; +Cc: yc-core, qemu-devel, qemu-block, Max Reitz

Am 07.05.2019 um 10:12 hat Anton Kuchin geschrieben:
> Close involves flush that can be performed asynchronously and bs
> must be protected from being referenced before it is deleted.
> 
> Signed-off-by: Anton Kuchin <antonkuchin@yandex-team.ru>

Thanks, applied to the block branch.

Kevin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-07  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-07  8:12 [Qemu-devel] [PATCH] block: remove bs from lists before closing Anton Kuchin
2019-05-07  8:53 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).