summaryrefslogtreecommitdiffstats
path: root/src/cls
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2014-12-23 00:03:04 +0100
committerYehuda Sadeh <yehuda@redhat.com>2015-01-20 00:57:59 +0100
commitc4cf0e2eaa6b1cfeb8a558769808e6ec4f308be7 (patch)
tree3629477e324dc52f01fda6568614f0808eb9c082 /src/cls
parentrgw: multi object delete supports versioning (diff)
downloadceph-c4cf0e2eaa6b1cfeb8a558769808e6ec4f308be7.tar.xz
ceph-c4cf0e2eaa6b1cfeb8a558769808e6ec4f308be7.zip
cls/rgw: when removing delete marker, clean up instance entry
Since we create the instance entry at the bucket index, we should also remove it. Otherwise we end up with objects that have bucket index entries, but don't have olh. In these cases we'll be failin operations on these objects, as their bucket index olh tag will always mismatch the actual object olh tag. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/cls')
-rw-r--r--src/cls/rgw/cls_rgw.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc
index c6cdbadf678..2d683f44c89 100644
--- a/src/cls/rgw/cls_rgw.cc
+++ b/src/cls/rgw/cls_rgw.cc
@@ -1575,6 +1575,12 @@ static int rgw_bucket_unlink_instance(cls_method_context_t hctx, bufferlist *in,
if (!obj.is_delete_marker()) {
olh.update_log(CLS_RGW_OLH_OP_REMOVE_INSTANCE, op.op_tag, op.key, false);
+ } else {
+ /* this is a delete marker, it's our responsibility to remove its instance entry */
+ ret = obj.unlink();
+ if (ret < 0) {
+ return ret;
+ }
}
ret = obj.unlink_list_entry();