]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: catch exceptions in ::decode
authorJohn Spray <john.spray@redhat.com>
Thu, 19 Mar 2015 20:15:47 +0000 (20:15 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 23 Mar 2015 18:20:10 +0000 (18:20 +0000)
...and translate them into more readily handlable -EINVALs

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/JournalPointer.cc

index 0ceb758a9b7540e0b40fc396643e7590ed91c80b..68e8aa4877273923b190e45ade14cdcd579e595e 100644 (file)
@@ -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;
   }