]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Multipart Upload: Support to configure and enforce no of parts allowed 5091/head
authorAbhishek Dixit <dixitabhi@gmail.com>
Sun, 14 Jun 2015 17:58:16 +0000 (23:28 +0530)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 26 Jun 2015 16:38:31 +0000 (09:38 -0700)
Fixes: #12146
Config parameter added for no of parts limit in multipart upload and checked while
completing multipart upload

Signed-off-by: Abhishek Dixit <dixitabhi@gmail.com>
src/common/config_opts.h
src/rgw/rgw_op.cc

index 93bb608f7e33a1481889779c612ede30353ff6b4..ebe1cf397cf46c93c97372fc9d6e0715f41bb2d6 100644 (file)
@@ -1055,6 +1055,7 @@ OPTION(rgw_user_quota_sync_idle_users, OPT_BOOL, false) // whether stats for idl
 OPTION(rgw_user_quota_sync_wait_time, OPT_INT, 3600 * 24) // min time between two full stats sync for non-idle users
 
 OPTION(rgw_multipart_min_part_size, OPT_INT, 5 * 1024 * 1024) // min size for each part (except for last one) in multipart upload
+OPTION(rgw_multipart_part_upload_limit, OPT_INT, 10000) // parts limit in multipart upload
 
 OPTION(rgw_olh_pending_timeout_sec, OPT_INT, 3600) // time until we retire a pending olh change
 
index 6dae8cc048f5fe27393f31493eaf68d84235a54e..250154230a39446e546e49e2922590602340553b 100644 (file)
@@ -3130,6 +3130,11 @@ void RGWCompleteMultipart::execute()
     return;
   }
 
+  if (parts->parts.size() > s->cct->_conf->rgw_multipart_part_upload_limit) {
+    ret = -ERANGE;
+    return;
+  }
+
   mp.init(s->object.name, upload_id);
   meta_oid = mp.get_meta();