mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
Merge pull request #11345 from jcsp/wip-mgr-assert
messages: fix out of range assertion Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
0919de25cb
src
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user