]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw:fix list objects with marker when bucket is enable versioning 17934/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Sun, 24 Sep 2017 00:41:04 +0000 (08:41 +0800)
committeryuliyang <yuliyang@cmss.chinamobile.com>
Tue, 17 Oct 2017 16:53:23 +0000 (00:53 +0800)
fix: http://tracker.ceph.com/issues/21500

Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
src/cls/rgw/cls_rgw.cc

index f699628518047be76fc06db362b5a1707e5c0908..04908999ed8a4bb43ead18d7732eb6fea793d92b 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;
       }