From bc16b162cf757b9c6ceae30912eb647ef9304f75 Mon Sep 17 00:00:00 2001 From: yuliyang Date: Sun, 24 Sep 2017 08:41:04 +0800 Subject: [PATCH] rgw:fix list objects with marker when bucket is enable versioning fix: http://tracker.ceph.com/issues/21500 Signed-off-by: yuliyang --- src/cls/rgw/cls_rgw.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index f6996285180..04908999ed8 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -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; }