]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix list versions starts with version_id=null 30743/head
authorTianshan Qu <tianshan@xsky.com>
Mon, 26 Aug 2019 12:32:03 +0000 (20:32 +0800)
committerNathan Cutler <ncutler@suse.com>
Sun, 6 Oct 2019 22:19:12 +0000 (00:19 +0200)
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 <tianshan@xsky.com>
(cherry picked from commit 120df4bb38f60a9a934ce6c8f8b029ef323221b1)

src/cls/rgw/cls_rgw.cc

index fd707eeea9b4406506de162b4c8b01510d083534..188d02eb97f12ae2cb9f7273d4d65211a0322cb1 100644 (file)
@@ -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;