Skip to content

Commit

Permalink
rgw: fix error ListMultipart allways returns StorageClass:STANDARD
Browse files Browse the repository at this point in the history
  • Loading branch information
Huber-ming committed Nov 12, 2021
1 parent 9a4b3c1 commit 3525550
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rgw/rgw_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6525,7 +6525,7 @@ void RGWListMultipart::execute(optional_yield y)
upload = s->bucket->get_multipart_upload(s->object->get_name(), upload_id);

rgw::sal::Attrs attrs;
op_ret = upload->get_info(this, s->yield, s->obj_ctx, nullptr, &attrs);
op_ret = upload->get_info(this, s->yield, s->obj_ctx, &placement, &attrs);
/* decode policy */
map<string, bufferlist>::iterator iter = attrs.find(RGW_ATTR_ACL);
if (iter != attrs.end()) {
Expand Down
1 change: 1 addition & 0 deletions src/rgw/rgw_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,7 @@ class RGWListMultipart : public RGWOp {
int marker;
RGWAccessControlPolicy policy;
bool truncated;
rgw_placement_rule* placement;

public:
RGWListMultipart() {
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_rest_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3832,7 +3832,7 @@ void RGWListMultipart_ObjStore_S3::send_response()
s->formatter->dump_string("Bucket", s->bucket_name);
s->formatter->dump_string("Key", s->object->get_name());
s->formatter->dump_string("UploadId", upload_id);
s->formatter->dump_string("StorageClass", "STANDARD");
s->formatter->dump_string("StorageClass", placement->get_storage_class());
s->formatter->dump_int("PartNumberMarker", marker);
s->formatter->dump_int("NextPartNumberMarker", cur_max);
s->formatter->dump_int("MaxParts", max_parts);
Expand Down

0 comments on commit 3525550

Please sign in to comment.