diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-09-12 10:36:39 +0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-10-10 04:25:34 -0700 |
commit | 3a3724b782c53c92c45624ad02df9f0de77f1545 (patch) | |
tree | 7ab5f26f39219ed15a1c05fdf3e7e015e46f7f36 | |
parent | 102f63993cacf3b3404256e62a3096c5836f2282 (diff) | |
download | ceph-3a3724b782c53c92c45624ad02df9f0de77f1545.tar.gz |
osdc/ObjectCacher: finish contexts after dropping object reference
The context to finish can be class C_Client_PutInode, which may drop
inode's last reference. So we should first drop object's reference,
then finish contexts.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
(cherry picked from commit b66ac77fa7aa3ff37804918c4308a348f239af09)
-rw-r--r-- | src/osdc/ObjectCacher.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 01eeccc03be..590b5d473a8 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -899,11 +899,10 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start, ob->last_commit_tid = tid; // waiters? + list<Context*> ls; if (ob->waitfor_commit.count(tid)) { - list<Context*> ls; ls.splice(ls.begin(), ob->waitfor_commit[tid]); ob->waitfor_commit.erase(tid); - finish_contexts(cct, ls, r); } // is the entire object set now clean and fully committed? @@ -915,6 +914,9 @@ void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start, oset->dirty_or_tx == 0) { // nothing dirty/tx flush_set_callback(flush_set_callback_arg, oset); } + + if (!ls.empty()) + finish_contexts(cct, ls, r); } } |