1
0
mirror of https://github.com/ceph/ceph synced 2025-02-24 19:47:44 +00:00

Merge pull request from jcsp/wip-mgr-assert

messages: fix out of range assertion

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2016-10-25 16:02:33 +08:00 committed by GitHub
commit 0919de25cb
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class CephContext;
class PerfCountersBuilder;
class PerfCountersCollectionTest;
enum perfcounter_type_d
enum perfcounter_type_d : uint8_t
{
PERFCOUNTER_NONE = 0,
PERFCOUNTER_TIME = 0x1,

View File

@ -36,7 +36,7 @@ public:
::encode(path, bl);
::encode(description, bl);
::encode(nick, bl);
assert(type < 256);
static_assert(sizeof(type) == 1, "perfcounter_type_d must be one byte");
::encode((uint8_t)type, bl);
ENCODE_FINISH(bl);
}