Skip to content

Commit

Permalink
Merge pull request #30741 from smithfarm/wip-41714-nautilus
Browse files Browse the repository at this point in the history
nautilus: rgw: fix refcount tags to match and update object's idtag

Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
  • Loading branch information
yuriw committed Dec 18, 2019
2 parents afd25bc + e8216d0 commit 91dd67b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rgw/rgw_rados.cc
Expand Up @@ -4839,9 +4839,10 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
vector<rgw_raw_obj>::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);

Expand Down Expand Up @@ -6287,9 +6288,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;
Expand Down

0 comments on commit 91dd67b

Please sign in to comment.