Skip to content

Commit 43a6f12

Browse files
author
Shilpa Jagannath
committed
rgw/multisite: the create_bucket forward request omits the
the request body, thus missing some data if specified inside CreateBucketConfiguration xml on the non-master zone. also, now that we perform cksum validation against empty payloads, such a request would fail with -ERR_AMZ_CONTENT_SHA256_MISMATCH due to a zero content-length but a non-empty payload hash. this fix ensures that request body is forwarded during create_bucket Signed-off-by: Shilpa Jagannath <[email protected]>
1 parent cbbddfd commit 43a6f12

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/rgw/rgw_op.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3618,7 +3618,6 @@ void RGWCreateBucket::execute(optional_yield y)
36183618

36193619
if (!driver->is_meta_master()) {
36203620
// apply bucket creation on the master zone first
3621-
bufferlist in_data;
36223621
JSONParser jp;
36233622
op_ret = rgw_forward_request_to_master(this, *s->penv.site, s->owner.id,
36243623
&in_data, &jp, s->info, y);

src/rgw/rgw_op.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@ class RGWCreateBucket : public RGWOp {
11171117
bool relaxed_region_enforcement = false;
11181118
RGWCORSConfiguration cors_config;
11191119
std::set<std::string> rmattr_names;
1120+
bufferlist in_data;
11201121

11211122
virtual bool need_metadata_upload() const { return false; }
11221123

src/rgw/rgw_rest_s3.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,6 +2492,10 @@ int RGWCreateBucket_ObjStore_S3::get_params(optional_yield y)
24922492
if ((op_ret < 0) && (op_ret != -ERR_LENGTH_REQUIRED))
24932493
return op_ret;
24942494

2495+
if (!driver->is_meta_master()) {
2496+
in_data.append(data);
2497+
}
2498+
24952499
if (data.length()) {
24962500
RGWCreateBucketParser parser;
24972501

0 commit comments

Comments
 (0)