]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix version bucket stats 25643/head
authorlu.shasha <lu.shasha@eisoo.com>
Tue, 19 Sep 2017 06:01:37 +0000 (14:01 +0800)
committerPrashant D <pdhange@redhat.com>
Thu, 20 Dec 2018 03:53:08 +0000 (22:53 -0500)
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>
(cherry picked from commit 52a843c598bc0553d8e75ea8290731e26a83aed1)

src/cls/rgw/cls_rgw.cc

index 01c04259d29ef1190929933d38408f946d08aaef..dc5fd1fc77cac089b444f8261f91d7c5695648fa 100644 (file)
@@ -1435,13 +1435,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);
   }