From: John Spray Date: Thu, 19 Mar 2015 20:15:47 +0000 (+0000) Subject: mds: catch exceptions in ::decode X-Git-Tag: v9.0.0~113^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b4d96bbbb4f4bb46d6723b3ef4e461cb5eb62d3;p=ceph.git mds: catch exceptions in ::decode ...and translate them into more readily handlable -EINVALs Signed-off-by: John Spray --- diff --git a/src/mds/JournalPointer.cc b/src/mds/JournalPointer.cc index 0ceb758a9b75..68e8aa487727 100644 --- a/src/mds/JournalPointer.cc +++ b/src/mds/JournalPointer.cc @@ -56,7 +56,11 @@ int JournalPointer::load(Objecter *objecter) // Construct JournalPointer result, null or decoded data if (r == 0) { bufferlist::iterator q = data.begin(); - decode(q); + try { + decode(q); + } catch (const buffer::error &e) { + return -EINVAL; + } } else { dout(1) << "Journal pointer '" << object_id << "' read failed: " << cpp_strerror(r) << dendl; }