]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: abort incomplete multiparts on bucket delete
authorAbhishek Varshney <abhishek.varshney@flipkart.com>
Fri, 16 Jun 2017 12:41:47 +0000 (18:11 +0530)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 20 Jun 2017 17:42:42 +0000 (17:42 +0000)
Fixes: http://tracker.ceph.com/issues/17164
Signed-off-by: Abhishek Varshney <abhishek.varshney@flipkart.com>
src/rgw/rgw_op.cc

index 64ec8a02b5c5fe1a6d45af1c87b8a6fb992c30bf..7a3fd29ef19487e93cb8b1a51bf79c0571efe4e9 100644 (file)
@@ -2696,6 +2696,27 @@ void RGWDeleteBucket::execute()
     }
   }
 
+  string prefix, delimiter;
+
+  if (s->prot_flags & RGW_REST_SWIFT) {
+    string path_args;
+    path_args = s->info.args.get("path");
+    if (!path_args.empty()) {
+      if (!delimiter.empty() || !prefix.empty()) {
+        op_ret = -EINVAL;
+        return;
+      }
+      prefix = path_args;
+      delimiter="/";
+    }
+  }
+
+  op_ret = abort_bucket_multiparts(store, s->cct, s->bucket_info, prefix, delimiter);
+
+  if (op_ret < 0) {
+    return;
+  }
+
   op_ret = store->delete_bucket(s->bucket_info, ot, false);
 
   if (op_ret == -ECANCELED) {