void FSMap::decode(bufferlist::const_iterator& p)
{
+ struct_version = 0;
DECODE_START(STRUCT_VERSION, p);
DECODE_OLDEST(7);
struct_version = struct_v;
derr << "could not get version " << v << dendl;
ceph_abort();
}
- fsmap.decode(bl);
+ try {
+ fsmap.decode(bl);
+ } catch (const ceph::buffer::malformed_input& e) {
+ dout(5) << "flushing old fsmap struct because unable to decode FSMap: " << e.what() << dendl;
+ }
+ /* N.B. FSMap::is_struct_old is also true for undecoded (failed to decode) FSMap */
if (fsmap.is_struct_old()) {
dout(5) << "fsmap struct is too old; proposing to flush out old versions" << dendl;
do_propose = true;