]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filejournal: do not enforce that bdev size >= osd journal size
authorSage Weil <sage@inktank.com>
Wed, 12 Sep 2012 00:12:06 +0000 (17:12 -0700)
committerSage Weil <sage@inktank.com>
Tue, 18 Sep 2012 01:23:39 +0000 (18:23 -0700)
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 <sage@inktank.com>
Reviewed-by: Tommi Virtanen <tv@inktank.com>
src/os/FileJournal.cc

index 21535108cf266549ed60a25f58290fa528327516..baee133340f43c17a14d241d26a7b5762e3e8108 100644 (file)
@@ -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 */