]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: do not reuse partition if encryption required 3424/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 20 Jan 2015 17:53:52 +0000 (18:53 +0100)
committerLoic Dachary <ldachary@redhat.com>
Tue, 20 Jan 2015 18:07:29 +0000 (19:07 +0100)
If encryption is required, an existing journal partition must not be
reused. If an existing partition that was not prepared with ceph-disk is
found and reused, the caller will assume it is encrypted although it is
not.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk

index a57b413060709a9ddcb3bdff32e7ed26297e05ef..ccceecaf66973a6ef32a85133afc15b3ec393a84 100755 (executable)
@@ -1051,6 +1051,9 @@ def prepare_journal_dev(
     reusing_partition = False
 
     if is_partition(journal):
+        if journal_dm_keypath:
+            raise Error(journal + ' partition already exists'
+                        ' and --dmcrypt specified')
         LOG.debug('Journal %s is a partition', journal)
         LOG.warning('OSD will not be hot-swappable if journal is not the same device as the osd data')
         if get_partition_type(journal) == JOURNAL_UUID: