ss << "specified pgp_num " << n << " > pg_num " << p.get_pg_num();
return -EINVAL;
}
- for(set<pg_t>::iterator i = mon->pgmon()->pg_map.creating_pgs.begin();
- i != mon->pgmon()->pg_map.creating_pgs.end();
- ++i) {
- if (i->m_pool == static_cast<uint64_t>(pool)) {
- ss << "currently creating pgs, wait";
- return -EBUSY;
- }
- }
p.set_pgp_num(n);
+ } else if (var == "crush_rule") {
+ int id = osdmap.crush->get_rule_id(val);
+ if (id == -ENOENT) {
+ ss << "crush rule " << val << " does not exist";
+ return -ENOENT;
+ }
+ if (id < 0) {
+ ss << cpp_strerror(id);
+ return -ENOENT;
+ }
+ if (!osdmap.crush->check_crush_rule(id, p.get_type(), p.get_size(), ss)) {
+ return -EINVAL;
+ }
+ p.crush_ruleset = id;
} else if (var == "crush_ruleset") {
if (interr.length()) {
ss << "error parsing integer value '" << val << "': " << interr;