From: Patrick Donnelly Date: Thu, 15 Jul 2021 01:00:24 +0000 (-0700) Subject: mon/MDSMonitor: give a proper error message if FSMap struct_v is too old X-Git-Tag: v15.2.14~7^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=60ad0ca622cf64dad99f89cea2b520dce1322fbf;p=ceph.git mon/MDSMonitor: give a proper error message if FSMap struct_v is too old Fixes: https://tracker.ceph.com/issues/51673 Signed-off-by: Patrick Donnelly (cherry picked from commit 4298f9758138c30e08975a84ced25d81e1fd53b9) --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 0ce59c79c410..1b7f5dfc31af 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -120,7 +120,12 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap) ceph_assert(fsmap_bl.length() > 0); dout(10) << __func__ << " got " << version << dendl; - PaxosFSMap::decode(fsmap_bl); + try { + PaxosFSMap::decode(fsmap_bl); + } catch (const ceph::buffer::malformed_input& e) { + derr << "unable to decode FSMap: " << e.what() << dendl; + throw; + } // new map dout(0) << "new map" << dendl;