Skip to content

Commit

Permalink
rgw: make rollback refcount tag match
Browse files Browse the repository at this point in the history
When the refcount does a "get", the tag ends with a null character,
but during a rollback, when the tag is "put" it does not end with a
null character, so the same tag is not being manipulated and the
refcounts are therefore off, preventing future deletion of an rgw
object. This adds the null character to the "put" operation.

This change was originally submitted by lltlo <120680451@qq.com> but
wasn't signed-off.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
  • Loading branch information
ivancich committed Aug 29, 2019
1 parent 7d32b08 commit a0fee94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rgw/rgw_rados.cc
Expand Up @@ -4152,9 +4152,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.pool.ioctx().locator_set_key(riter->loc);

Expand Down

0 comments on commit a0fee94

Please sign in to comment.