From: Loic Dachary Date: Wed, 2 Mar 2016 09:14:16 +0000 (+0700) Subject: ceph-disk: map after luks formatting X-Git-Tag: v10.1.0~200^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=003dc15443353639fd8ef41320bf7436c391e8be;p=ceph.git ceph-disk: map after luks formatting dmcrypt_map is idempotent, it does not matter that it is called multiple times when activating or preparing a device. It is however important to not cryptsetup remove the device after preparing it because partprobe may not re-send another add udev event to luksOpen / create it again. On Ubuntu 14.04, no extra add udev event is sent after the partition was acknowledged by the kernel. On CentOS 7.2 an extra udev event is sent for each existing partition, regardless of what the kernel already knows. The format() function is just a call to map() to limit the extent of the refactor. The dmcrypt_map/unmap functions should be refactored into a device class and the format() function can then be made more specific. Signed-off-by: Loic Dachary --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 17d3d6ddfc6c..77d530186d23 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -1657,7 +1657,6 @@ class DevicePartitionCrypt(DevicePartition): def format(self): self.setup_crypt() self.map() - self.unmap() class DevicePartitionCryptPlain(DevicePartitionCrypt): @@ -2062,6 +2061,7 @@ class PrepareSpace(object): if isinstance(partition, DevicePartitionCrypt): partition.format() + partition.map() command_check_call( [