apexd: fix race condition in dm-device manipulation
Note, this is a rather rare race condition.
When creating/deleting dm-devices apexd is wrongly waiting on the
corresponding path (i.e. /dev/block/dm-XX) to be created/deleted, which
can cause a race condition in case another process is creating/deleting
a dm-device at the same time, because the paths can be re-used.
Instead apexd now uses overloads of
DeviceMapper::CreateDevice/DeleteDevice that accept a timeout and wait
for the dm-device **unique path** to be created/deleted.
Bug: 122059364
Test: apest apexservice_test
Change-Id: Ie66db6cb8d615139a0f7ff8a844b7b022c7f7ecc
1 file changed