]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw : add check for zonegroup when create existing bucket
authorcao.leilc <cao.leilc@inspur.com>
Sat, 22 Aug 2020 02:05:01 +0000 (10:05 +0800)
committercao.leilc <cao.leilc@inspur.com>
Sat, 22 Aug 2020 02:05:01 +0000 (10:05 +0800)
Fixes: https://tracker.ceph.com/issues/47027
Signed-off-by: caolei <halei15848934852@163.com>
src/rgw/rgw_op.cc

index b91d2085434ef73ab08991f1bce6e54b518d879e..33a512536836c726f6abdd251a82e0dad8cfa611 100644 (file)
@@ -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();
   }