From: Sage Weil Date: Wed, 12 Sep 2012 00:12:06 +0000 (-0700) Subject: filejournal: do not enforce that bdev size >= osd journal size X-Git-Tag: v0.53~126 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6b0c9ffc8b019f287b121cc0f436b86515259c78;p=ceph.git filejournal: do not enforce that bdev size >= osd journal size If the configure osd journal size is > the block device size, warn, but do not generate an error and abort startup. This makes it safe to have a default 'osd journal size' value of, say, 1 GB without fear of breaking existing clusters with smaller jouranl block devices. Signed-off-by: Sage Weil Reviewed-by: Tommi Virtanen --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 21535108cf266..baee133340f43 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -138,22 +138,20 @@ int FileJournal::_open_block_device() int64_t conf_journal_sz(g_conf->osd_journal_size); conf_journal_sz <<= 20; - if (bdev_sz < conf_journal_sz) { - dout(0) << __func__ << ": you have configured a journal of size " - << conf_journal_sz << ", but the block device " << fn << " is only " - << bdev_sz << " bytes in size." << dendl; - return -EINVAL; - } if (conf_journal_sz == 0) { dout(10) << __func__ << ": no journal size specified in configuration. " << "We'll use the entire block device (size: " << bdev_sz << ")" << dendl; max_size = bdev_sz; } - else { + else if (bdev_sz > conf_journal_sz) { dout(10) << __func__ << ": using " << conf_journal_sz << " bytes " << "of a " << bdev_sz << " byte block device." << dendl; max_size = conf_journal_sz; + } else { + dout(0) << __func__ << ": WARNING: configured 'osd journal size' is " + << conf_journal_sz << ", but " << fn << " is only " + << bdev_sz << " bytes." << dendl; } /* block devices have to write in blocks of CEPH_PAGE_SIZE */