]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #24374 from smithfarm/wip-26919-luminous
authorYuri Weinstein <yweinste@redhat.com>
Mon, 7 Jan 2019 17:21:28 +0000 (09:21 -0800)
committerGitHub <noreply@github.com>
Mon, 7 Jan 2019 17:21:28 +0000 (09:21 -0800)
luminous: common: (mon) command sanitization accepts floats when Int type is defined resulting in exception fault in ceph-mon

Reviewed-by: Sage Weil <sage@redhat.com>
1  2 
src/common/cmdparse.h
src/mon/MDSMonitor.cc
src/mon/OSDMonitor.cc

Simple merge
Simple merge
index 8376a40668515147de23329a842182d8cd261697,b8696615b02304b0103b926333cb60d6e4b2ed9a..ac2c3b5242f047e5886f36f25ee62a7eb35ee63e
@@@ -10868,27 -10875,8 +10877,27 @@@ bool OSDMonitor::prepare_command_impl(M
        goto reply;
      }
  
 +    if (expected_num_objects > 0 &&
 +      cct->_conf->osd_objectstore == "filestore" &&
 +      cct->_conf->filestore_merge_threshold > 0) {
 +      ss << "'expected_num_objects' requires 'filestore_merge_threshold < 0'";
 +      err = -EINVAL;
 +      goto reply;
 +    }
 +
 +    if (expected_num_objects == 0 &&
 +      cct->_conf->osd_objectstore == "filestore" &&
 +      cct->_conf->filestore_merge_threshold < 0) {
 +      int osds = osdmap.get_num_osds();
 +      if (osds && (pg_num >= 1024 || pg_num / osds >= 100)) {
 +        ss << "For better initial performance on pools expected to store a "
 +         << "large number of objects, consider supplying the "
 +         << "expected_num_objects parameter when creating the pool.\n";
 +      }
 +    }
 +
      int64_t fast_read_param;
-     cmd_getval(g_ceph_context, cmdmap, "fast_read", fast_read_param, int64_t(-1));
+     cmd_getval_throws(g_ceph_context, cmdmap, "fast_read", fast_read_param, int64_t(-1));
      FastReadType fast_read = FAST_READ_DEFAULT;
      if (fast_read_param == 0)
        fast_read = FAST_READ_OFF;