From 35255508865c07308e0d299b9a3232d0ff51962d Mon Sep 17 00:00:00 2001 From: Huber-ming Date: Sat, 6 Nov 2021 16:24:33 +0800 Subject: [PATCH] rgw: fix error ListMultipart allways returns StorageClass:STANDARD Fixes: https://tracker.ceph.com/issues/53183 Signed-off-by: Huber-ming --- src/rgw/rgw_op.cc | 2 +- src/rgw/rgw_op.h | 1 + src/rgw/rgw_rest_s3.cc | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index b2354f3140f33..a7518df18dbf1 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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::iterator iter = attrs.find(RGW_ATTR_ACL); if (iter != attrs.end()) { diff --git a/src/rgw/rgw_op.h b/src/rgw/rgw_op.h index fa2c69fab572e..2b182667191b1 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -1900,6 +1900,7 @@ protected: int marker; RGWAccessControlPolicy policy; bool truncated; + rgw_placement_rule* placement; public: RGWListMultipart() { diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index baeb0ad6eb4c6..01e24075098d2 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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); -- 2.39.5