22/05/2018 11:05, Burakov, Anatoly: > On 21-May-18 5:11 PM, Thomas Monjalon wrote: > > The lock vdev_device_list_lock was taken before calling > > "remove" function for the device. > > So it prevents to remove sub-devices (as in failsafe) inside > > its own "remove" function, because of a deadlock. > > > > The lock is now only protecting the device list inside > > the bus driver. > > > > Fixes: 35f462839b69 ("bus/vdev: add lock on device list") > > > > Signed-off-by: Thomas Monjalon <tho...@monjalon.net> > > Without that lock, all of this would be racy - find_dev would iterate a > tailq that might change under its feet, and tailq_remove may be called > with a pointer that has already been removed. > > How about changing the lock to a recursive lock? Failsafe would be > removing devices from within the same thread, correct?
Yes it could work. I will give it a try.