]> 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>
Tue, 8 Nov 2016 23:16:52 +0000 (15:16 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/ReplicatedPG.cc

index 00ba62be7289a7130fba98c0e77074ba2836edbd..9d06c038ac5056d1f2b8c618b7ce592dcbbba5c8 100644 (file)
@@ -9200,7 +9200,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());