From 68af510914bdba1786b7d02bc6e8bc635d6647fd Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Tue, 20 Jan 2015 18:53:52 +0100 Subject: [PATCH] ceph-disk: do not reuse partition if encryption required 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 --- src/ceph-disk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ceph-disk b/src/ceph-disk index a57b413060709..ccceecaf66973 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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: -- 2.39.5