]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix version bucket stats
authorlu.shasha <lu.shasha@eisoo.com>
Tue, 19 Sep 2017 06:01:37 +0000 (14:01 +0800)
committerlu.shasha <lu.shasha@eisoo.com>
Thu, 22 Nov 2018 02:34:18 +0000 (10:34 +0800)
when link a null version delete_marker and the null version instance exists, the existing null version idx should not unlinked in rgw_bucket_link_olh. It will be removed in delete_obj.

Fixes: http://tracker.ceph.com/issues/21429
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
src/cls/rgw/cls_rgw.cc

index 662f6f031d1e1bc8f17a07a55aba03f3be08418d..c6a53c0f32290fe517a38933318e919fdc722ef0 100644 (file)
@@ -1433,13 +1433,15 @@ static int rgw_bucket_link_olh(cls_method_context_t hctx, bufferlist *in, buffer
       if (ret < 0) {
         return ret;
       }
+    }
+
+    removing = existed && op.delete_marker;
+    if (!removing) {
       ret = other_obj.unlink();
       if (ret < 0) {
         return ret;
       }
     }
-
-    removing = existed && op.delete_marker;
   } else {
     removing = (existed && !obj.is_delete_marker() && op.delete_marker);
   }