]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: do not take Object ref for bh writes
authorSage Weil <sage@inktank.com>
Tue, 13 Nov 2012 00:31:35 +0000 (16:31 -0800)
committerSage Weil <sage@inktank.com>
Tue, 13 Nov 2012 00:31:35 +0000 (16:31 -0800)
This reverts commit 46897fd4ffc2fe2fc2cc0c39b5d4c510df1e6c25.

There is no reason to carry a ref for the writes; it just makes things
more confusing because the refs aren't used for lifecycle, only for
LRU pinning.  We would need to duplicate the close_object() conditional
here for this to work right.

This fixes #3431, in which a slow osd reply has an Object pinned, but when
we try to truncate it away we hit the assert in can_close().

Signed-off-by: Sage Weil <sage@inktank.com>
src/osdc/ObjectCacher.cc

index 0229e39fd3cc5e6063d8bcda4297d03406714ada..c8d2449e3c327e98ce89c9e7fd33287a9b1266cc 100644 (file)
@@ -684,8 +684,6 @@ 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,
@@ -794,9 +792,6 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start,
 
     // is the entire object set now clean and fully committed?
     ObjectSet *oset = ob->oset;
-    ob->put();
-
-    // is the entire object set now clean?
     if (flush_set_callback &&
        was_dirty_or_tx > 0 &&
        oset->dirty_or_tx == 0) {        // nothing dirty/tx