Skip to content

Commit

Permalink
osd: Handle corrupt attributes in get_object_context()
Browse files Browse the repository at this point in the history
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 30f8b0d)
  • Loading branch information
dzafman committed Feb 9, 2017
1 parent 8006ba7 commit c7c3e07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/osd/ReplicatedPG.cc
Expand Up @@ -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());

Expand Down

0 comments on commit c7c3e07

Please sign in to comment.