]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: update olh log when unlinking entry
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 16 Oct 2014 21:26:37 +0000 (14:26 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 19 Jan 2015 23:57:44 +0000 (15:57 -0800)
Need to update log so that later client will be able to appropriately
remove the object.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/cls/rgw/cls_rgw.cc

index e6ff801e66acba0feb39ed939f20966ea64072ae..b31845a1bf555249c7146cb3fc3a7eac1fa24a85 100644 (file)
@@ -952,7 +952,6 @@ static int read_key_list_entry(cls_method_context_t hctx, cls_rgw_obj_key& key,
 
   int ret = read_index_entry(hctx, *idx, entry);
   if (ret < 0) {
-    CLS_LOG(0, "ERROR: read_index_entry() reading previous instance %s ret=%d", idx->c_str(), ret);
     return ret;
   }
 
@@ -1209,8 +1208,16 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
 
     ret = read_key_list_entry(hctx, no_instance_key, &plain_entry, &plain_idx);
     if (ret >= 0) {
-#warning handle overwrite of non-olh object, need to update log
+#warning handle overwrite of non-olh object, need to update stats
       ret = cls_cxx_map_remove_key(hctx, plain_idx);
+      if (ret < 0) {
+        CLS_LOG(0, "ERROR: cls_Cxx_map_remove_key() ret=%d", ret);
+        return ret;
+      }
+
+      if (!plain_entry.is_delete_marker()) {
+        olh.update_log(CLS_RGW_OLH_OP_REMOVE_INSTANCE, op.op_tag, plain_entry.key, false);
+      }
     }
   }