summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Deza <alfredo@deza.pe>2013-10-02 11:13:43 -0700
committerAlfredo Deza <alfredo@deza.pe>2013-10-02 11:13:43 -0700
commit8fb7a47601276fe82acb271c8ac966e1b86d17f0 (patch)
tree84f6c5647f3f55d73d546ae996f76c7eea37b933
parent348890232d590d656162f3d7c0a85742f3cf1760 (diff)
parenta786ad773cd33880075f1deb3691528d1afd03ec (diff)
downloadceph-8fb7a47601276fe82acb271c8ac966e1b86d17f0.tar.gz
Merge pull request #678 from ceph/wip-5981
ceph-disk: make initial journal files 0 bytes
-rwxr-xr-xsrc/ceph-disk13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ceph-disk b/src/ceph-disk
index 0691d252cd7..939f65b85dd 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -888,15 +888,12 @@ def prepare_journal_dev(
def prepare_journal_file(
- journal,
- journal_size):
+ journal):
if not os.path.exists(journal):
- LOG.debug('Creating journal file %s with size %dM', journal, journal_size)
+ LOG.debug('Creating journal file %s with size 0 (ceph-osd will resize and allocate)', journal)
with file(journal, 'wb') as journal_file:
- journal_file.truncate(journal_size * 1048576)
-
- # FIXME: should we resize an existing journal file?
+ pass
LOG.debug('Journal is file %s', journal)
LOG.warning('OSD will not be hot-swappable if journal is not the same device as the osd data')
@@ -921,13 +918,13 @@ def prepare_journal(
if not os.path.exists(journal):
if force_dev:
raise Error('Journal does not exist; not a block device', journal)
- return prepare_journal_file(journal, journal_size)
+ return prepare_journal_file(journal)
jmode = os.stat(journal).st_mode
if stat.S_ISREG(jmode):
if force_dev:
raise Error('Journal is not a block device', journal)
- return prepare_journal_file(journal, journal_size)
+ return prepare_journal_file(journal)
if stat.S_ISBLK(jmode):
if force_file: