From 003dc15443353639fd8ef41320bf7436c391e8be Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 2 Mar 2016 16:14:16 +0700 Subject: [PATCH] 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 --- src/ceph-disk/ceph_disk/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 17d3d6ddfc6c3..77d530186d23a 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( [ -- 2.39.5