int r = rados->ioctx_create(RGW_ROOT_BUCKET, root_pool_ctx);
if (r == -ENOENT) {
r = rados->pool_create(RGW_ROOT_BUCKET);
+ if (r == -EEXIST)
+ r = 0;
if (r < 0)
return r;
int r = rados->ioctx_create(RGW_CONTROL_BUCKET, control_pool_ctx);
if (r == -ENOENT) {
r = rados->pool_create(RGW_CONTROL_BUCKET);
+ if (r == -EEXIST)
+ r = 0;
if (r < 0)
return r;
* if auid is set, it sets the auid of the underlying rados io_ctx
* returns 0 on success, -ERR# otherwise.
*/
-int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket, map<std::string, bufferlist>& attrs, bool create_pool, bool exclusive, uint64_t auid)
+int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket,
+ map<std::string, bufferlist>& attrs,
+ bool create_pool, bool exclusive, uint64_t auid)
{
librados::ObjectWriteOperation op;
op.create(exclusive);
if (create_pool) {
ret = rados->pool_create(bucket.pool.c_str(), auid);
+ if (ret == -EEXIST)
+ ret = 0;
if (ret < 0)
root_pool_ctx.remove(bucket.name.c_str());
}