]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rados: set_attrs() falls back to existing attrs for index update 58649/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 17 Jul 2024 14:28:08 +0000 (10:28 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 17 Jul 2024 14:28:10 +0000 (10:28 -0400)
set_attrs() needs the ACLOwner, etag, content-type and storage class for
the bucket index update. if those attrs aren't being updated, consult
their existing attrs in state->attrset

Fixes: https://tracker.ceph.com/issues/64173
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_rados.cc

index b010a63d44347f9319e55ceab8683ef746ef2e64..74684bec1ee6ce64999690795da5c820c38ef6c6 100644 (file)
@@ -6588,18 +6588,30 @@ int RGWRados::set_attrs(const DoutPrefixProvider *dpp, RGWObjectCtx* octx, RGWBu
       ACLOwner owner;
       if (iter = attrs.find(RGW_ATTR_ACL); iter != attrs.end()) {
         (void) decode_policy(dpp, iter->second, &owner);
+      } else if (iter = state->attrset.find(RGW_ATTR_ACL);
+                 iter != state->attrset.end()) {
+        (void) decode_policy(dpp, iter->second, &owner);
       }
       std::string etag;
       if (iter = attrs.find(RGW_ATTR_ETAG); iter != attrs.end()) {
         etag = rgw_bl_str(iter->second);
+      } else if (iter = state->attrset.find(RGW_ATTR_ETAG);
+                 iter != state->attrset.end()) {
+        etag = rgw_bl_str(iter->second);
       }
       std::string content_type;
       if (iter = attrs.find(RGW_ATTR_CONTENT_TYPE); iter != attrs.end()) {
         content_type = rgw_bl_str(iter->second);
+      } else if (iter = state->attrset.find(RGW_ATTR_CONTENT_TYPE);
+                 iter != state->attrset.end()) {
+        content_type = rgw_bl_str(iter->second);
       }
       string storage_class;
       if (iter = attrs.find(RGW_ATTR_STORAGE_CLASS); iter != attrs.end()) {
         storage_class = rgw_bl_str(iter->second);
+      } else if (iter = state->attrset.find(RGW_ATTR_STORAGE_CLASS);
+                 iter != state->attrset.end()) {
+        storage_class = rgw_bl_str(iter->second);
       }
       uint64_t epoch = ioctx.get_last_version();
       int64_t poolid = ioctx.get_id();