From cef5151a62e130bf09bd03b6b8d2a15f4e694047 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 2 Jun 2016 17:38:05 -0700 Subject: [PATCH] hobject: enforce max canonical value Signed-off-by: Samuel Just --- src/common/hobject.cc | 1 + src/common/hobject.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/common/hobject.cc b/src/common/hobject.cc index 8c3f9a2692d..dc76e8b5524 100644 --- a/src/common/hobject.cc +++ b/src/common/hobject.cc @@ -112,6 +112,7 @@ void hobject_t::encode(bufferlist& bl) const ::encode(max, bl); ::encode(nspace, bl); ::encode(pool, bl); + assert(!max || (*this == hobject_t(hobject_t::get_max()))); ENCODE_FINISH(bl); } diff --git a/src/common/hobject.h b/src/common/hobject.h index 69bb6111602..d15426ee624 100644 --- a/src/common/hobject.h +++ b/src/common/hobject.h @@ -179,6 +179,7 @@ public: } bool is_max() const { + assert(!max || (*this == hobject_t(hobject_t::get_max()))); return max; } bool is_min() const {