From: Abhishek Dixit Date: Sun, 14 Jun 2015 17:58:16 +0000 (+0530) Subject: rgw: Multipart Upload: Support to configure and enforce no of parts allowed X-Git-Tag: v9.0.3~113^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=876fbc64ba68d0014eccad37e117971f86c59403;p=ceph.git rgw: Multipart Upload: Support to configure and enforce no of parts allowed Fixes: #12146 Config parameter added for no of parts limit in multipart upload and checked while completing multipart upload Signed-off-by: Abhishek Dixit --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 93bb608f7e33..ebe1cf397cf4 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 6dae8cc048f5..250154230a39 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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();