]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWDeleteCORS should be forwarded to master zone
authorChang Liu <liuchang0812@gmail.com>
Tue, 28 May 2019 08:46:52 +0000 (16:46 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 24 Jun 2019 10:09:26 +0000 (12:09 +0200)
Signed-off-by: Chang Liu <liuchang0812@gmail.com>
(cherry picked from commit 03ab155a8f399186e17aea56e2b05b5cd7886e4f)

src/rgw/rgw_op.cc

index 19c07140f3369eb7e9a41c176c84dd94f6b8b23c..fa300ce5157becc15cc873d6cec95754af566009 100644 (file)
@@ -5338,6 +5338,15 @@ int RGWDeleteCORS::verify_permission()
 
 void RGWDeleteCORS::execute()
 {
+  if (!store->svc.zone->is_meta_master()) {
+    bufferlist data;
+    op_ret = forward_request_to_master(s, nullptr, store, data, nullptr);
+    if (op_ret < 0) {
+      ldpp_dout(this, 0) << "forward_request_to_master returned ret=" << op_ret << dendl;
+      return;
+    }
+  }
+
   op_ret = retry_raced_bucket_write(store, s, [this] {
       op_ret = read_bucket_cors();
       if (op_ret < 0)