diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 94b316482d339..a806be7690cb3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -8591,9 +8591,10 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx, vector::iterator riter; /* rollback reference */ + string ref_tag = tag + '\0'; for (riter = ref_objs.begin(); riter != ref_objs.end(); ++riter) { ObjectWriteOperation op; - cls_refcount_put(op, tag, true); + cls_refcount_put(op, ref_tag, true); ref.ioctx.locator_set_key(riter->loc); @@ -10190,9 +10191,15 @@ int RGWRados::set_attrs(void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& sr state->attrset.erase(iter->first); } } + for (iter = attrs.begin(); iter != attrs.end(); ++iter) { state->attrset[iter->first] = iter->second; } + + auto iter = state->attrset.find(RGW_ATTR_ID_TAG); + if (iter != state->attrset.end()) { + iter->second = state->obj_tag; + } } return 0;