From c4cf0e2eaa6b1cfeb8a558769808e6ec4f308be7 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 22 Dec 2014 15:03:04 -0800 Subject: [PATCH] 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 --- src/cls/rgw/cls_rgw.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index c6cdbadf67821..2d683f44c8949 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(); -- 2.39.5