From: cao.leilc Date: Sat, 22 Aug 2020 02:05:01 +0000 (+0800) Subject: rgw : add check for zonegroup when create existing bucket X-Git-Tag: v16.1.0~1092^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fba31de3dfb23775ea18753430285a07a72d5801;p=ceph.git rgw : add check for zonegroup when create existing bucket Fixes: https://tracker.ceph.com/issues/47027 Signed-off-by: caolei --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index b91d2085434e..33a512536836 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -3131,6 +3131,11 @@ void RGWCreateBucket::execute() s->bucket_exists = (op_ret != -ENOENT); if (s->bucket_exists) { + if (!s->system_request && + store->svc()->zone->get_zonegroup().get_id() != s->bucket->get_info().zonegroup) { + op_ret = -EEXIST; + return; + } /* Initialize info from req_state */ info = s->bucket->get_info(); }