From 1d651538854671ddac1d9a1762ad89b9fdbb61c3 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Fri, 11 Sep 2020 15:39:30 -0400 Subject: [PATCH] rgw: return success on existing bucket RGWRadosStore::create_bucket() only returns EEXIST errors when a conflict is detected and the recreation should fail. in other cases, return success and use the 'bool *existed' flag to notify the caller of its prior existence Signed-off-by: Casey Bodley --- src/rgw/rgw_sal_rados.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index ae779ba96ff6..122d63588262 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -925,6 +925,7 @@ int RGWRadosStore::create_bucket(RGWUser& u, const rgw_bucket& b, pmaster_bucket, pmaster_num_shards, exclusive); if (ret == -EEXIST) { *existed = true; + ret = 0; } else if (ret != 0) { return ret; } -- 2.47.3