osdc/ObjectCacher: take Object ref for bh writes

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-10-23 06:04:08 -07:00
parent 21dc0e0262
commit 46897fd4ff

View File

@ -617,6 +617,8 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, loff_t start,
void ObjectCacher::bh_write(BufferHead *bh)
{
ldout(cct, 7) << "bh_write " << *bh << dendl;
bh->ob->get();
// finishers
C_WriteCommit *oncommit = new C_WriteCommit(this, bh->ob->oloc.pool,
@ -777,6 +779,7 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start,
ObjectSet *oset = ob->oset;
if (ob->can_close())
close_object(ob);
ob->put();
// is the entire object set now clean?
if (flush_set_callback &&