[PATCH] virNWFilterLockIface: Preserve correct lock ordering

Erik Skultety eskultet at redhat.com
Fri Mar 18 16:44:38 UTC 2022


On Fri, Mar 18, 2022 at 05:33:20PM +0100, Michal Privoznik wrote:
> In the not so distant past, the lock ordering in
> virNWFilterLockIface() was as follows: global mutex ifaceMapLock
> was acquired, then internal representation of given interface was
> looked up in a hash table (or created brand new if none was
> found), the global lock was released and the lock of the
> interface was acquired.
> 
> But this was mistakenly changed as the function was rewritten to
> use automatic mutexes, because now the global lock is held
> throughout the whole run of the function and thus the interface
> specific lock is acquired with the global lock held. This results
> in a deadlock.
> 
> Fixes: dd8150c48dcf94e8d3b0481be08eeef822b98b02
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---

Tested-by: Erik Skultety <eskultet at redhat.com>
Reviewed-by: Erik Skultety <eskultet at redhat.com>



More information about the libvir-list mailing list