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: v13.2.7~36^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0a87c3d05b8babe6aee7f7843ca33a0be678172c;p=ceph.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 (cherry picked from commit 120df4bb38f60a9a934ce6c8f8b029ef323221b1) --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index fb90602b185..779a0698f09 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -281,7 +281,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;