From: Sage Weil Date: Mon, 18 Jan 2016 14:55:17 +0000 (-0500) Subject: os/kstore: fix u64 decode checks X-Git-Tag: v10.0.3~26 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=328610631d4cfff6f9b4f18b4c0e25dec91eb059;p=ceph.git os/kstore: fix u64 decode checks Signed-off-by: Sage Weil --- diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index b4b59cc1b05..c9fbf4a5204 100644 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -302,19 +302,13 @@ static int get_key_object(const string& key, ghobject_t *oid) const char *p = key.c_str(); p = _key_decode_shard(p, &oid->shard_id); - if (!*p) - return -2; uint64_t pool; p = _key_decode_u64(p, &pool); - if (!*p) - return -3; oid->hobj.pool = pool - 0x8000000000000000ull; unsigned hash; p = _key_decode_u32(p, &hash); - if (!*p) - return -4; oid->hobj.set_bitwise_key_u32(hash); if (*p != '.') return -5; @@ -351,8 +345,6 @@ static int get_key_object(const string& key, ghobject_t *oid) } p = _key_decode_u64(p, &oid->hobj.snap.val); - if (!*p) - return -11; p = _key_decode_u64(p, &oid->generation); if (*p) { // if we get something other than a null terminator here,