]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: protect deactivate with activate lock
authorLoic Dachary <ldachary@redhat.com>
Fri, 18 Dec 2015 23:53:03 +0000 (00:53 +0100)
committerLoic Dachary <ldachary@redhat.com>
Wed, 6 Jan 2016 16:47:14 +0000 (17:47 +0100)
commit379bbe0613e8dbe2f4d38f4f9ee23a10ed39a64d
tree68eea950aaea24108af9fd462380ddd5e5c85508
parent4da2f9494dbd72e84d381cc12125c61931a27628
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.
qa/workunits/ceph-disk/ceph-disk-test.py