From b82ca3c63b98489a58d9d17075a5bd35b0b8b443 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Thu, 29 Aug 2019 10:41:53 -0400 Subject: [PATCH] rgw: make rollback refcount tag match 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 (cherry picked from commit a0fee94982d89f0210e1c526605831105cd90ef4) Conflicts: src/rgw/rgw_rados.cc --- src/rgw/rgw_rados.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 402715d9b45c6..a806be7690cb3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -8591,9 +8591,10 @@ done_ret: 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); -- 2.39.5