[libvirt] [PATCH] nodedev: Fix double unlock of the driver on udevEnumerateDevices failure

Michal Privoznik mprivozn at redhat.com
Fri Jul 28 09:31:27 UTC 2017


On 07/26/2017 10:45 AM, Erik Skultety wrote:
> Commit @4cb719b2dc moved the driver locks around since these have become
> unnecessary at spots where the code handles now self-lockable object
> list, but missed the possible double unlock if udevEnumerateDevices
> fails, because at that point the driver lock had been already dropped.
> 
> Signed-off-by: Erik Skultety <eskultet at redhat.com>
> ---
>  src/node_device/node_device_udev.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 

I know you already pushed this but what's the point of node driver lock
anyway? There are only two places where the driver lock is used - init
and cleanup. Moreover with the current code still racy, except not
really beacuse init and cleanup will never be called concurrently.
Therefore the lock can be dropped entirely.

Michal




More information about the libvir-list mailing list