Merge pull request #16511 from c744402859/master

OSDMonitor: check mon_max_pool_pg_num when set pool pg_num

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
Yuri Weinstein 2017-07-25 13:46:25 -07:00 committed by GitHub
commit 65185cf09e

View File

@ -6055,6 +6055,12 @@ int OSDMonitor::prepare_command_pool_set(map<string,cmd_vartype> &cmdmap,
return -EEXIST;
return 0;
}
if (n > (unsigned)g_conf->mon_max_pool_pg_num) {
ss << "'pg_num' must be greater than 0 and less than or equal to "
<< g_conf->mon_max_pool_pg_num
<< " (you may adjust 'mon max pool pg num' for higher values)";
return -ERANGE;
}
string force;
cmd_getval(g_ceph_context,cmdmap, "force", force);
if (p.cache_mode != pg_pool_t::CACHEMODE_NONE &&