]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:fix list objects with marker when bucket is enable versioning 20291/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Sun, 24 Sep 2017 00:41:04 +0000 (08:41 +0800)
committerNathan Cutler <ncutler@suse.com>
Sun, 4 Feb 2018 03:25:59 +0000 (04:25 +0100)
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 03314a17ac4061c62ff3a216e7a4644061c0daa7..7ddc00023b9b0c07c1769df55df522932b506feb 100644 (file)
@@ -473,8 +473,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;
       }