]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: fix list versions starts with version_id=null
authorTianshan Qu <tianshan@xsky.com>
Mon, 26 Aug 2019 12:32:03 +0000 (20:32 +0800)
committerTianshan Qu <tianshan@xsky.com>
Mon, 26 Aug 2019 12:32:03 +0000 (20:32 +0800)
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>
src/cls/rgw/cls_rgw.cc

index 0486bbd6c12317c2197ebe6da8503532f91dedd5..dcdd46f9a2a82aa77c6a31e5e02d06f3847dafc2 100644 (file)
@@ -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;