]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: make rollback refcount tag match 30741/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 29 Aug 2019 14:41:53 +0000 (10:41 -0400)
committerNathan Cutler <ncutler@suse.com>
Sun, 6 Oct 2019 22:14:39 +0000 (00:14 +0200)
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>
(cherry picked from commit a0fee94982d89f0210e1c526605831105cd90ef4)

src/rgw/rgw_rados.cc

index a2d0fbcc2a01f5985ad328df3134ba4a8b0f745a..9c3e9c86201b4938f4548c8cd1fad05d73456e67 100644 (file)
@@ -4819,9 +4819,10 @@ done_ret:
     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);