From: Sage Weil Date: Fri, 25 Jun 2021 19:42:14 +0000 (-0400) Subject: mon/OSDMonitor: remove check_crush_rule() callers X-Git-Tag: v17.1.0~1398^2~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c2ee041d814c6ceb1a8ab4c71eed29a4d5fe1c7;p=ceph.git mon/OSDMonitor: remove check_crush_rule() callers The only useful check remaining is that the rule type matches the pool. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 872e5749f41a..6257e486df9d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7906,7 +7906,8 @@ int OSDMonitor::prepare_new_pool(string& name, return r; } - if (!osdmap.crush->check_crush_rule(crush_rule, pool_type, size, *ss)) { + if (osdmap.crush->get_rule_type(crush_rule) != (int)pool_type) { + *ss << "crush rule " << crush_rule << " type does not match pool"; return -EINVAL; } @@ -8164,7 +8165,8 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, return -EPERM; } } - if (!osdmap.crush->check_crush_rule(p.get_crush_rule(), p.type, n, ss)) { + if (osdmap.crush->get_rule_type(p.get_crush_rule()) != (int)p.type) { + ss << "crush rule " << p.get_crush_rule() << " type does not match pool"; return -EINVAL; } int r = check_pg_num(pool, p.get_pg_num(), n, &ss); @@ -8376,7 +8378,8 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, ss << cpp_strerror(id); return -ENOENT; } - if (!osdmap.crush->check_crush_rule(id, p.get_type(), p.get_size(), ss)) { + if (osdmap.crush->get_rule_type(id) != (int)p.get_type()) { + ss << "crush rule " << id << " type does not match pool"; return -EINVAL; } p.crush_rule = id;