From: Yuri Weinstein Date: Mon, 7 Jan 2019 17:21:28 +0000 (-0800) Subject: Merge pull request #24374 from smithfarm/wip-26919-luminous X-Git-Tag: v12.2.11~71 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ace88f8496e49b02d449e2de21b84eeed49076e;p=ceph.git Merge pull request #24374 from smithfarm/wip-26919-luminous luminous: common: (mon) command sanitization accepts floats when Int type is defined resulting in exception fault in ceph-mon Reviewed-by: Sage Weil --- 4ace88f8496e49b02d449e2de21b84eeed49076e diff --cc src/mon/OSDMonitor.cc index 8376a4066851,b8696615b023..ac2c3b5242f0 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@@ -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;