]> git.apps.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>
Wed, 9 Sep 2020 09:32:05 +0000 (12:32 +0300)
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>
(cherry picked from commit c1eff9f7812b131c10df245ae92450d70623de2b)

src/os/kstore/KStore.cc
src/test/objectstore/store_test.cc

index 3cb8e4a02584941792d72408768727d59466e7be..a16e72e344430c98d66a0a3f68479d6c5f166d44 100644 (file)
@@ -89,10 +89,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 ade6c3f7ff4b6fa6af5f111aee1abb64462d6270..41bb168e6c7bee7ce2447e6b99e1777efa077765 100644 (file)
@@ -4610,9 +4610,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};