From: Tianshan Qu Date: Mon, 26 Aug 2019 12:32:03 +0000 (+0800) Subject: rgw: fix list versions starts with version_id=null X-Git-Tag: v15.1.0~1492^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=120df4bb38f60a9a934ce6c8f8b029ef323221b1;p=ceph-ci.git rgw: fix list versions starts with version_id=null list with version_id=null, the null will be treated as a "null" version in cls rgw_bucket_list, which cause the list return wrong keys Fixes: https://tracker.ceph.com/issues/41433 Signed-off-by: Tianshan Qu --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 0486bbd6c12..dcdd46f9a2a 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -283,7 +283,11 @@ static int encode_list_index_key(cls_method_context_t hctx, const cls_rgw_obj_ke } string obj_index_key; - encode_obj_index_key(key, &obj_index_key); + cls_rgw_obj_key tmp_key(key); + if (tmp_key.instance == "null") { + tmp_key.instance.clear(); + } + encode_obj_versioned_data_key(tmp_key, &obj_index_key); rgw_bucket_dir_entry entry;