OSD: _have_pg should return NULL if pg is not in map

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2012-05-14 13:12:18 -07:00 committed by Sage Weil
parent ff470104d1
commit 36a3979590

View File

@ -1236,7 +1236,8 @@ bool OSD::_have_pg(pg_t pgid)
PG *OSD::_lookup_lock_pg(pg_t pgid)
{
assert(osd_lock.is_locked());
assert(pg_map.count(pgid));
if (!pg_map.count(pgid))
return NULL;
PG *pg = pg_map[pgid];
pg->lock();
return pg;