ceph-disk: protect deactivate with activate lock
When ceph-disk prepares the disk, it triggers udev events and each of
them ceph-disk activate. If systemctl stop ceph-osd@2 happens while
there still are ceph-disk activate in flight, the systemctl stop may be
cancelled by the systemctl enable issued by one of the pending ceph-disk
activate.
This only matters in a test environment where disks are destroyed
shortly after they are activated.
Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit
6395bf856b4d4511f0758174ef915ebcafbe3777)
Conflicts:
src/ceph-disk: ceph-disk deactivate does not exist in ceph-disk
on infernalis. But the same feature is implemented in
ceph-test-disk.py for test purposes and has the same
problem. The patch is adapted to ceph-test-disk.py.