From: Yuan Zhou Date: Thu, 9 Jul 2015 08:56:07 +0000 (+0800) Subject: [backport] rgw: Make RGW_MAX_PUT_SIZE configurable X-Git-Tag: v0.94.6~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5c8d1d74069f70b85bc4286e6d1136bce1dc593f;p=ceph.git [backport] rgw: Make RGW_MAX_PUT_SIZE configurable The 5GB limit of a single operation uploading was part of S3 spec. However some private setups may have some special requirements on this limit. It's more convinent to have a configurable value. Closes: http://tracker.ceph.com/issues/14569 (cherry picked from commit df97f28) Signed-off-by: Yuan Zhou Signed-off-by: Vladislav Odintsov Tested-by: Vladislav Odintsov --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 155ab84b9deb..fd53899abbb2 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -932,6 +932,7 @@ OPTION(nss_db_path, OPT_STR, "") // path to nss db OPTION(rgw_max_chunk_size, OPT_INT, 512 * 1024) +OPTION(rgw_max_put_size, OPT_U64, 5ULL*1024*1024*1024) /** * override max bucket index shards in zone configuration (if not zero) diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 5b4e39b0113c..d05e3167adb1 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -80,7 +80,6 @@ using ceph::crypto::MD5; #define RGW_BUCKETS_OBJ_SUFFIX ".buckets" #define RGW_MAX_PENDING_CHUNKS 16 -#define RGW_MAX_PUT_SIZE (5ULL*1024*1024*1024) #define RGW_MIN_MULTIPART_SIZE (5ULL*1024*1024) #define RGW_FORMAT_PLAIN 0 diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index a444f3f91e81..859e34a770b6 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -817,7 +817,7 @@ int RGWPutObj_ObjStore::verify_params() { if (s->length) { off_t len = atoll(s->length); - if (len > (off_t)RGW_MAX_PUT_SIZE) { + if (len > (off_t)(s->cct->_conf->rgw_max_put_size)) { return -ERR_TOO_LARGE; } } @@ -856,7 +856,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl) bl.append(bp, 0, len); } - if ((uint64_t)ofs + len > RGW_MAX_PUT_SIZE) { + if ((uint64_t)ofs + len > s->cct->_conf->rgw_max_put_size) { return -ERR_TOO_LARGE; } @@ -875,7 +875,7 @@ int RGWPostObj_ObjStore::verify_params() return -ERR_LENGTH_REQUIRED; } off_t len = atoll(s->length); - if (len > (off_t)RGW_MAX_PUT_SIZE) { + if (len > (off_t)(s->cct->_conf->rgw_max_put_size)) { return -ERR_TOO_LARGE; }