Skip to content

Commit

Permalink
os/kstore: fix collection_list ordering
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
trociny committed Aug 29, 2020
1 parent f2ccd54 commit c1eff9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/os/kstore/KStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/test/objectstore/store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit c1eff9f

Please sign in to comment.