From 2b4d96bbbb4f4bb46d6723b3ef4e461cb5eb62d3 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 19 Mar 2015 20:15:47 +0000 Subject: [PATCH] mds: catch exceptions in ::decode ...and translate them into more readily handlable -EINVALs Signed-off-by: John Spray --- src/mds/JournalPointer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mds/JournalPointer.cc b/src/mds/JournalPointer.cc index 0ceb758a9b754..68e8aa4877273 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; } -- 2.39.5