diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index bd30db33818..96a721821d8 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -469,7 +469,9 @@ int RGWRados::create_bucket(string& owner, rgw_bucket& bucket, string dir_oid = dir_oid_prefix; dir_oid.append(bucket.marker); - r = io_ctx.create(dir_oid, true); + librados::ObjectWriteOperation op; + op.create(true); + r = cls_rgw_init_index(io_ctx, op, dir_oid); if (r < 0 && r != -EEXIST) return r; @@ -479,12 +481,6 @@ int RGWRados::create_bucket(string& owner, rgw_bucket& bucket, ret = store_bucket_info(info, &attrs, exclusive); if (ret == -EEXIST) return ret; - - if (r != -EEXIST) { - r = cls_rgw_init_index(bucket, dir_oid); - if (r < 0) - return r; - } } return ret; @@ -2115,23 +2111,11 @@ int RGWRados::pool_list(rgw_bucket& bucket, string start, uint32_t num, map