From: Sage Weil Date: Mon, 21 May 2012 20:58:55 +0000 (-0700) Subject: monmap: fix decoding of old monmaps X-Git-Tag: v0.48argonaut~137^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c06fb20a8a4a9729b6f8a1e5cbcbb51204cb47c0;p=ceph.git monmap: fix decoding of old monmaps The old monmaps had a u16 for the version. Fix our decode. Signed-off-by: Sage Weil --- diff --git a/src/include/encoding.h b/src/include/encoding.h index 9ab05a957aa4..2db2a4224fab 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 33c04213707b..420e830fbb82 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) {