]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-disk: prepare --data-dir must not override files
authorLoic Dachary <loic@dachary.org>
Mon, 30 Dec 2013 11:26:20 +0000 (12:26 +0100)
committerAlfredo Deza <alfredo@deza.pe>
Wed, 12 Feb 2014 21:17:11 +0000 (16:17 -0500)
commit5df1eaa55bc7ebe68473831d06cf9819fa39baa6
tree60bd3f26cf78d4c97a722071fcf2029b42b8db4e
parent2e8496a6e0b74ff351bc2a4f138ddc665d8c30ca
ceph-disk: prepare --data-dir must not override files

ceph-disk does nothing when given a device that is already prepared. If
given a directory that already contains a successfully prepared OSD, it
will however override it.

Instead of overriding the files in the osd data directory, return
immediately if the magic file exists. Make it so the magic file is
created last to accurately reflect the success of the OSD preparation.

Signed-off-by: Loic Dachary <loic@dachary.org>
(cherry picked from commit 7dfe550ce18623cde4ae43a2416e31ef81381ab9)
src/ceph-disk
src/test/cli/ceph-disk/data-dir.t [new file with mode: 0644]