]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Handle corrupt attributes in get_object_context()
authorDavid Zafman <dzafman@redhat.com>
Fri, 12 Aug 2016 19:06:31 +0000 (12:06 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 9 Feb 2017 17:16:07 +0000 (09:16 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 30f8b0d6593718dd10bcf6ff459c95b4bb68c05c)

src/osd/ReplicatedPG.cc

index e5c0e8d89d62c659c3b7d13b4408a06447b5d9e2..baff1806d515eefccc51489daa363fe45d00ee53 100644 (file)
@@ -8943,7 +8943,14 @@ ObjectContextRef ReplicatedPG::get_object_context(const hobject_t& soid,
       }
     }
 
-    object_info_t oi(bv);
+    object_info_t oi;
+    try {
+      bufferlist::iterator bliter = bv.begin();
+      ::decode(oi, bliter);
+    } catch (...) {
+      dout(0) << __func__ << ": obc corrupt: " << soid << dendl;
+      return ObjectContextRef();   // -ENOENT!
+    }
 
     assert(oi.soid.pool == (int64_t)info.pgid.pool());