Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
if (s->bucket_exists) {
s->dest_placement.storage_class = s->info.storage_class;
s->dest_placement.inherit_from(s->bucket_info.placement_rule);
+
+ if (!store->svc.zone->get_zone_params().valid_placement(s->dest_placement)) {
+ ldpp_dout(s, 0) << "NOTICE: invalid dest placement: " << s->dest_placement.to_str() << dendl;
+ return -EINVAL;
+ }
}
}
}
bool exists(const string& sc) const {
+ if (sc.empty()) {
+ return true;
+ }
auto iter = m.find(sc);
return (iter != m.end());
}
}
return true;
}
+
+ bool valid_placement(const rgw_placement_rule& rule) const {
+ auto iter = placement_pools.find(rule.name);
+ if (iter == placement_pools.end()) {
+ return false;
+ }
+ return iter->second.storage_class_exists(rule.storage_class);
+ }
};
WRITE_CLASS_ENCODER(RGWZoneParams)