diff options
author | Greg Farnum <greg@inktank.com> | 2013-09-11 16:24:32 -0700 |
---|---|---|
committer | Greg Farnum <greg@inktank.com> | 2013-09-11 16:24:32 -0700 |
commit | c3d921e0facef84f3194c326259d8282e610c6b2 (patch) | |
tree | 3cb139db1096f44b5c21b928ed1cf78f33c2d7b0 | |
parent | 73e626ccea957a7ecca8ee872c6a6350cdcc7cf2 (diff) | |
download | ceph-c3d921e0facef84f3194c326259d8282e610c6b2.tar.gz |
mds: be more careful about decoding LogEventswip-4221
We need to wrap the full decode section or we can abort the process
if there's an issue (which we may want to just skip by).
Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r-- | src/mds/LogEvent.cc | 14 |
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); } |