From: Huber-ming Date: Thu, 12 May 2022 07:09:15 +0000 (+0800) Subject: rgw: check object storage_class when check_disk_state X-Git-Tag: v16.2.11~405^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6b50284a8b6492f89fa0c2d2b23115a6b75b3ba;p=ceph.git rgw: check object storage_class when check_disk_state fix: https://tracker.ceph.com/issues/55618 Signed-off-by: Huber-ming (cherry picked from commit 4a2e553b5d9621bf346185155588560a3960a5c1) --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 7d54a6368439..aefecdc4a835 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -8982,6 +8982,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, string etag; string content_type; + string storage_class; ACLOwner owner; object.meta.size = astate->size; @@ -8996,6 +8997,10 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, if (iter != astate->attrset.end()) { content_type = rgw_bl_str(iter->second); } + iter = astate->attrset.find(RGW_ATTR_STORAGE_CLASS); + if (iter != astate->attrset.end()) { + storage_class = rgw_bl_str(iter->second); + } iter = astate->attrset.find(RGW_ATTR_ACL); if (iter != astate->attrset.end()) { r = decode_policy(iter->second, &owner); @@ -9024,6 +9029,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, object.meta.etag = etag; object.meta.content_type = content_type; + object.meta.storage_class = storage_class; object.meta.owner = owner.get_id().to_str(); object.meta.owner_display_name = owner.get_display_name(); @@ -9035,6 +9041,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, list_state.meta.category = main_category; list_state.meta.etag = etag; list_state.meta.content_type = content_type; + list_state.meta.storage_class = storage_class; librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id const bool head_pool_found =