]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: fix collection_list ordering
authorMykola Golub <mgolub@suse.com>
Wed, 19 Aug 2020 08:56:57 +0000 (09:56 +0100)
committerMykola Golub <mgolub@suse.com>
Sat, 29 Aug 2020 17:24:44 +0000 (18:24 +0100)
It has the same key escaping bug as the blustore has, but we
don't need to workaround it here because kstore is not in
production use.

Signed-off-by: Mykola Golub <mgolub@suse.com>
src/os/kstore/KStore.cc
src/test/objectstore/store_test.cc

index f1a9caa0bbee848498cc15887d9e13db74c052a5..9c701fdbd89756917db04377eb7ed7fbcb9f61ce 100644 (file)
@@ -104,10 +104,10 @@ static void append_escaped(const string &in, string *out)
 {
   char hexbyte[8];
   for (string::const_iterator i = in.begin(); i != in.end(); ++i) {
-    if (*i <= '#') {
+    if ((unsigned char)*i <= '#') {
       snprintf(hexbyte, sizeof(hexbyte), "#%02x", (uint8_t)*i);
       out->append(hexbyte);
-    } else if (*i >= '~') {
+    } else if ((unsigned char)*i >= '~') {
       snprintf(hexbyte, sizeof(hexbyte), "~%02x", (uint8_t)*i);
       out->append(hexbyte);
     } else {
index d91bfe06a2d59a4856242ea76a11ab0525991471..0458347e217b70bfd2bc33fa35e4abc181eff143 100644 (file)
@@ -5027,9 +5027,6 @@ TEST_P(StoreTest, HashCollisionTest) {
 }
 
 TEST_P(StoreTest, HashCollisionSorting) {
-  if (string(GetParam()) == "kstore") // TODO: fix kstore
-    return;
-
   char buf121664318_1[] = {18, -119, -121, -111, 0};
   char buf121664318_2[] = {19, 127, -121, 32, 0};
   char buf121664318_3[] = {19, -118, 15, 19, 0};