]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix version bucket stats 25644/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 04:24:43 +0000 (23:24 -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 656783d2655115dc5c16b62381bf31f89aad5e08..fba47d4601a10136726d54e186dc834c9db2489f 100644 (file)
@@ -1437,13 +1437,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);
   }