]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objectcacher: only call flushed callback if there are also no dirty buffers
authorSage Weil <sage@newdream.net>
Thu, 27 Nov 2008 00:42:01 +0000 (16:42 -0800)
committerSage Weil <sage@newdream.net>
Thu, 27 Nov 2008 00:42:01 +0000 (16:42 -0800)
Otherwise we call the flushed_callback too soon.

src/osdc/ObjectCacher.cc

index f3aebeeb249ea96eb53c0680d2820b4b7baed2ff..78bb3bd96298eba287918134c13b577f0a59eabf 100644 (file)
@@ -674,9 +674,10 @@ void ObjectCacher::bh_write_commit(object_t oid, loff_t start, size_t length, ti
     if (commit_set_callback &&
        ob->last_commit_tid == ob->last_write_tid) {
       ob->uncommitted_item.remove_myself();
-      if (uncommitted_by_ino[ob->get_ino()].empty()) {
+      if (uncommitted_by_ino[ob->get_ino()].empty()) {  // no uncommitted in flight
        uncommitted_by_ino.erase(ob->get_ino());
-       commit_set_callback(flush_set_callback_arg, ob->get_ino());      
+       if (dirty_tx_by_ino[ob->get_ino()] == 0)        // AND nothing dirty/tx
+         commit_set_callback(flush_set_callback_arg, ob->get_ino());      
       }
     }
   }