From: Yuan Zhou Date: Thu, 9 Jul 2015 08:56:07 +0000 (+0800) Subject: rgw: Make RGW_MAX_PUT_SIZE configurable X-Git-Tag: v9.0.3~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5183%2Fhead;p=ceph.git 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. Fixes: #6999 Signed-off-by: Yuan Zhou --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 1ea85a649662..7280310a7ce4 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 bef7fa89c993..a32d363797c3 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -83,7 +83,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 903f44140d9b..a03e31fabf2e 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -816,7 +816,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; } } @@ -855,7 +855,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; } @@ -874,7 +874,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; }