From eab096c188d2430ccc3e865b614b845f1a92af08 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Tue, 22 Oct 2024 13:17:14 -0400 Subject: [PATCH] rgw: fix empty storage class on display of multipart uploads Some multipart uploads do not have a stored storage class, however the code is written such that an empty storage class is treated as the "STANDARD" storage class. So when encoding the storage class in JSON, use the canonical storage. Signed-off-by: J. Eric Ivancich --- src/cls/rgw/cls_rgw_types.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc index d5f6ba4bdee..9fd60aaff3f 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -194,7 +194,9 @@ void rgw_bucket_dir_entry_meta::dump(Formatter *f) const utime_t ut(mtime); encode_json("mtime", ut, f); encode_json("etag", etag, f); - encode_json("storage_class", storage_class, f); + encode_json("storage_class", + rgw_placement_rule::get_canonical_storage_class(storage_class), + f); encode_json("owner", owner, f); encode_json("owner_display_name", owner_display_name, f); encode_json("content_type", content_type, f); -- 2.39.5