]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: give a proper error message if FSMap struct_v is too old
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 15 Jul 2021 01:00:24 +0000 (18:00 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 29 Jul 2021 15:57:34 +0000 (08:57 -0700)
Fixes: https://tracker.ceph.com/issues/51673
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 4298f9758138c30e08975a84ced25d81e1fd53b9)

src/mon/MDSMonitor.cc

index e09cb181a2c02fb358276434397eda127419db13..404e5932bcd75b5a1ade42b3c6a0e08fa32d1253 100644 (file)
@@ -146,7 +146,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;