Re: [PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-15 Thread Eric Blake
On Mon, May 15, 2023 at 06:19:41PM +0200, Kevin Wolf wrote: > > > @@ -3724,8 +3726,10 @@ qcow2_co_create(BlockdevCreateOptions > > > *create_options, Error **errp) > > > goto out; > > > } > > > > > > +bdrv_graph_co_rdlock(); > > > ret = qcow2_alloc_clusters(blk_bs(blk),

Re: [PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-15 Thread Kevin Wolf
Am 12.05.2023 um 18:12 hat Eric Blake geschrieben: > > On Wed, May 10, 2023 at 10:35:54PM +0200, Kevin Wolf wrote: > > > > These are functions that modify the graph, so they must be able to take > > a writer lock. This is impossible if they already hold the reader lock. > > If they need a reader

Re: [PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-12 Thread Eric Blake
On Wed, May 10, 2023 at 10:35:54PM +0200, Kevin Wolf wrote: > > These are functions that modify the graph, so they must be able to take > a writer lock. This is impossible if they already hold the reader lock. > If they need a reader lock for some of their operations, they should > take it inter

[PATCH 1/8] block: Call .bdrv_co_create(_opts) unlocked

2023-05-10 Thread Kevin Wolf
These are functions that modify the graph, so they must be able to take a writer lock. This is impossible if they already hold the reader lock. If they need a reader lock for some of their operations, they should take it internally. Many of them go through blk_*(), which will always take the lock