RGWStore::create_bucket() only returns EEXIST in case of conflicts that
should be returned to the client as errors. the code that applies
changes to metadata should instead use the s->bucket_exists flag
Signed-off-by: Casey Bodley <cbodley@redhat.com>
{
buffer::list aclbl;
buffer::list corsbl;
- bool existed;
string bucket_name = rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name);
rgw_raw_obj obj(store->svc()->zone->get_zone_params().domain_root, bucket_name);
* recover from a partial create by retrying it. */
ldpp_dout(this, 20) << "rgw_create_bucket returned ret=" << op_ret << " bucket=" << s->bucket.get() << dendl;
- if (op_ret && op_ret != -EEXIST)
+ if (op_ret)
return;
- existed = (op_ret == -EEXIST);
-
+ const bool existed = s->bucket_exists;
if (existed) {
/* bucket already existed, might have raced with another bucket creation, or
* might be partial bucket creation that never completed. Read existing bucket