From: Loic Dachary Date: Tue, 20 Jan 2015 17:53:52 +0000 (+0100) Subject: ceph-disk: do not reuse partition if encryption required X-Git-Tag: v0.93~203^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F3424%2Fhead;p=ceph.git 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index a57b4130607..ccceecaf669 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: