From fba31de3dfb23775ea18753430285a07a72d5801 Mon Sep 17 00:00:00 2001 From: "cao.leilc" Date: Sat, 22 Aug 2020 10:05:01 +0800 Subject: [PATCH] rgw : add check for zonegroup when create existing bucket Fixes: https://tracker.ceph.com/issues/47027 Signed-off-by: caolei --- src/rgw/rgw_op.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index b91d2085434..33a51253683 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(); } -- 2.39.5