]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rgw: when removing delete marker, clean up instance entry
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 22 Dec 2014 23:03:04 +0000 (15:03 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 19 Jan 2015 23:57:59 +0000 (15:57 -0800)
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>
src/cls/rgw/cls_rgw.cc

index c6cdbadf6782109e42cbcf37e3ecb61c92428622..2d683f44c8949899bcc3e8f20188ab089857b153 100644 (file)
@@ -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();