OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
282 stars 142 forks source link

Fix potential race condition in loop detach #2578

Closed schaefi closed 2 weeks ago

schaefi commented 2 weeks ago

The call to 'losetup -d' is in fact an async operation. Once the command returns the loop can still be associated with the former file because it gets lazy unbound and releases later. Prior re-use of the same loop device it is therefore required to wait until the kernel event queue is processed.