]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: check object storage_class when check_disk_state 46580/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:57:02 +0000 (14:57 -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 a27db1224fac3a1119ca0ac991c8d503648182e4..bc6c34e68bffb563f3e6f7c98567ea332b2899a6 100644 (file)
@@ -9154,6 +9154,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp,
 
   string etag;
   string content_type;
+  string storage_class;
   ACLOwner owner;
 
   object.meta.size = astate->size;
@@ -9168,6 +9169,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(dpp, iter->second, &owner);
@@ -9196,6 +9201,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();
 
@@ -9207,6 +9213,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
   int ret = get_obj_head_ioctx(dpp, bucket_info, obj, &head_obj_ctx);