]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check object storage_class when check_disk_state 46579/head
authorHuber-ming <zhangsm01@inspur.com>
Thu, 12 May 2022 07:09:15 +0000 (15:09 +0800)
committerCasey Bodley <cbodley@redhat.com>
Wed, 8 Jun 2022 18:55:39 +0000 (14:55 -0400)
fix: https://tracker.ceph.com/issues/55618

Signed-off-by: Huber-ming <zhangsm01@inspur.com>
(cherry picked from commit 4a2e553b5d9621bf346185155588560a3960a5c1)

src/rgw/rgw_rados.cc

index 7d54a63684392446f10467d8dd477b8fda4db4ee..aefecdc4a8351b3f4020e758f52d99e712d9146e 100644 (file)
@@ -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 =