From c06fb20a8a4a9729b6f8a1e5cbcbb51204cb47c0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 21 May 2012 13:58:55 -0700 Subject: [PATCH] monmap: fix decoding of old monmaps The old monmaps had a u16 for the version. Fix our decode. Signed-off-by: Sage Weil --- src/include/encoding.h | 3 +++ src/mon/MonMap.cc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/include/encoding.h b/src/include/encoding.h index 9ab05a957aa41..2db2a4224fab8 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -794,6 +794,9 @@ inline void decode(std::deque& ls, bufferlist::iterator& p) #define DECODE_START_LEGACY_COMPAT_LEN_32(v, compatv, lenv, bl) \ __DECODE_START_LEGACY_COMPAT_LEN(v, compatv, lenv, 3, bl) +#define DECODE_START_LEGACY_COMPAT_LEN_16(v, compatv, lenv, bl) \ + __DECODE_START_LEGACY_COMPAT_LEN(v, compatv, lenv, 1, bl) + /** * finish decode block * diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index 33c04213707b4..420e830fbb828 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -48,7 +48,7 @@ void MonMap::encode(bufferlist& blist, uint64_t features) const void MonMap::decode(bufferlist::iterator &p) { - DECODE_START_LEGACY_COMPAT_LEN(3, 3, 3, p); + DECODE_START_LEGACY_COMPAT_LEN_16(3, 3, 3, p); ::decode_raw(fsid, p); ::decode(epoch, p); if (struct_v == 1) { -- 2.39.5