]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
RGW - zipper - Set the instance in get_obj_attrs()
authorDaniel Gryniewicz <dang@fprintf.net>
Tue, 15 Apr 2025 14:37:42 +0000 (10:37 -0400)
committerDaniel Gryniewicz <dang@fprintf.net>
Thu, 1 May 2025 17:19:53 +0000 (13:19 -0400)
get_obj_attrs() gets the instance of the object, but isn't setting it
into the Object.  Do this, so that calling get_obj_attrs() ensures the
instance is correct.

Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
src/rgw/driver/rados/rgw_sal_rados.cc

index 8618868b3b1361b200e516dceff0ad1f879347cc..aa889ca7caa05f360ac34fd10063fb5db5d56f31 100644 (file)
@@ -2731,8 +2731,16 @@ int RadosObject::get_obj_attrs(optional_yield y, const DoutPrefixProvider* dpp)
 {
   RGWRados::Object op_target(store->getRados(), bucket->get_info(), *rados_ctx, get_obj());
   RGWRados::Object::Read read_op(&op_target);
+  rgw_obj target = get_obj();
+
+  int r = read_attrs(dpp, read_op, y, &target);
+  if (r < 0) {
+    return r;
+  }
 
-  return read_attrs(dpp, read_op, y);
+  set_instance(target.key.instance);
+
+  return 0;
 }
 
 int RadosObject::modify_obj_attrs(const char* attr_name, bufferlist& attr_val, optional_yield y, const DoutPrefixProvider* dpp, uint32_t flags)