qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] test-replication: Lock AioContext around blk_un


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] test-replication: Lock AioContext around blk_unref()
Date: Mon, 1 Oct 2018 18:13:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 01/10/2018 18:03, Kevin Wolf wrote:
>> Given the backtrace, I think bdrv_close should be taking the AioContext
>> lock instead of blockdev_close_all_bdrv_states.
> Conversely, that would mean that calling bdrv_unref() with the
> AioContext lock held is a bug (because close callbacks can involve
> AIO_WAIT_WHILE()). I'm not sure if that's very practical.

What if bdrv_unref_child dropped the lock?

Perhaps it's simpler to just kill the lock though, if
bdrv_set_aio_context can be figured out.

Paolo

> Of course, there will probably be a lot of callers to fix either way
> after we define whether to hold the lock for bdrv_unref() or not. Either
> you need to add locking to the places where it's missing or you need to
> drop the locks in all other places.
> 
> I was leaning towards requiring the lock for bdrv_unref() (and
> therefore blk_unref()).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]