Skip to content

Commit 37b438e

Browse files
authored
Merge pull request ceph#61465 from ArbitCode/wip-raja-fix-multipart-upload-cant-get-obj-tag
RGW:fix obj by multipart upload cant get tag
2 parents b7d3d39 + 3e2332d commit 37b438e

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/rgw/rgw_op.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6649,6 +6649,9 @@ void RGWInitMultipart::execute(optional_yield y)
66496649
return;
66506650
}
66516651

6652+
encode_obj_tags_attr(obj_tags, attrs);
6653+
rgw_cond_decode_objtags(s, attrs);
6654+
66526655
std::unique_ptr<rgw::sal::MultipartUpload> upload;
66536656
upload = s->bucket->get_multipart_upload(s->object->get_name(),
66546657
upload_id);

src/rgw/rgw_op.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,7 @@ class RGWSetRequestPayment : public RGWOp {
19041904

19051905
class RGWInitMultipart : public RGWOp {
19061906
protected:
1907+
RGWObjTags obj_tags;
19071908
std::string upload_id;
19081909
RGWAccessControlPolicy policy;
19091910
ceph::real_time mtime;

src/rgw/rgw_rest_s3.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4334,6 +4334,18 @@ int RGWInitMultipart_ObjStore_S3::get_params(optional_yield y)
43344334
if (ret < 0)
43354335
return ret;
43364336

4337+
auto tag_str = s->info.env->get("HTTP_X_AMZ_TAGGING");
4338+
if(tag_str) {
4339+
ret = obj_tags.set_from_string(tag_str);
4340+
if (ret < 0) {
4341+
ldpp_dout(this, 0) << "setting obj tags failed with " << ret << dendl;
4342+
if (ret == -ERR_INVALID_TAG) {
4343+
ret = -EINVAL; // s3 returns only -EINVAL for PUT requests
4344+
}
4345+
return ret;
4346+
}
4347+
}
4348+
43374349
//handle object lock
43384350
auto obj_lock_mode_str = s->info.env->get("HTTP_X_AMZ_OBJECT_LOCK_MODE");
43394351
auto obj_lock_date_str = s->info.env->get("HTTP_X_AMZ_OBJECT_LOCK_RETAIN_UNTIL_DATE");

0 commit comments

Comments
 (0)