summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mds/LogEvent.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mds/LogEvent.cc b/src/mds/LogEvent.cc
index b775b6d9501..16e7f803196 100644
--- a/src/mds/LogEvent.cc
+++ b/src/mds/LogEvent.cc
@@ -46,10 +46,16 @@ LogEvent *LogEvent::decode(bufferlist& bl)
::decode(type, p);
if (EVENT_NEW_ENCODING == type) {
- DECODE_START(1, p);
- ::decode(type, p);
- event = decode_event(bl, p, type);
- DECODE_FINISH(p);
+ try {
+ DECODE_START(1, p);
+ ::decode(type, p);
+ event = decode_event(bl, p, type);
+ DECODE_FINISH(p);
+ }
+ catch (const buffer::error &e) {
+ generic_dout(0) << "failed to decode LogEvent (type maybe " << type << ")" << dendl;
+ return NULL;
+ }
} else { // we are using classic encoding
event = decode_event(bl, p, type);
}