]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:fix list objects with marker when bucket is enable versioning 18569/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Sun, 24 Sep 2017 00:41:04 +0000 (08:41 +0800)
committerKarol Mroz <kmroz@suse.de>
Thu, 26 Oct 2017 22:24:21 +0000 (15:24 -0700)
fix: http://tracker.ceph.com/issues/21500

Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
(cherry picked from commit bc16b162cf757b9c6ceae30912eb647ef9304f75)

src/cls/rgw/cls_rgw.cc

index 17a618053a61effcb2185ba148fa93bf411b7bbe..7926761d580fcdac1c5ffba3808902b8115620ff 100644 (file)
@@ -445,8 +445,9 @@ int rgw_bucket_list(cls_method_context_t hctx, bufferlist *in, bufferlist *out)
         CLS_LOG(20, "entry %s[%s] is not valid\n", key.name.c_str(), key.instance.c_str());
         continue;
       }
-
-      if (!op.list_versions && !entry.is_visible()) {
+      
+      // filter out noncurrent versions, delete markers, and initial marker
+      if (!op.list_versions && (!entry.is_visible() || op.start_obj.name == key.name)) {
         CLS_LOG(20, "entry %s[%s] is not visible\n", key.name.c_str(), key.instance.c_str());
         continue;
       }