1
0
mirror of https://github.com/ceph/ceph synced 2024-12-20 02:13:04 +00:00

Merge pull request from ceph/wip-10828

objecter: fix linger cancel link bug 10828

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Sage Weil 2015-03-08 21:04:19 -07:00
commit 549a112c3d

View File

@ -1293,6 +1293,9 @@ void Objecter::_check_op_pool_dne(Op *op, bool session_locked)
if (op->oncommit) {
op->oncommit->complete(-ENOENT);
}
if (op->oncommit_sync) {
op->oncommit_sync->complete(-ENOENT);
}
OSDSession *s = op->session;
assert(s != NULL);
@ -2027,7 +2030,7 @@ void Objecter::_send_op_account(Op *op)
} else {
ldout(cct, 20) << " note: not requesting ack" << dendl;
}
if (op->oncommit) {
if (op->oncommit || op->oncommit_sync) {
num_uncommitted.inc();
} else {
ldout(cct, 20) << " note: not requesting commit" << dendl;
@ -2197,6 +2200,10 @@ int Objecter::op_cancel(OSDSession *s, ceph_tid_t tid, int r)
op->oncommit->complete(r);
op->oncommit = NULL;
}
if (op->oncommit_sync) {
op->oncommit_sync->complete(r);
op->oncommit_sync = NULL;
}
_op_cancel_map_check(op);
_finish_op(op);
s->lock.unlock();
@ -2656,6 +2663,7 @@ void Objecter::_cancel_linger_op(Op *op)
assert(!op->should_resend);
delete op->onack;
delete op->oncommit;
delete op->oncommit_sync;
_finish_op(op);
}
@ -2906,7 +2914,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
ldout(cct, 5) << " got redirect reply; redirecting" << dendl;
if (op->onack)
num_unacked.dec();
if (op->oncommit)
if (op->oncommit || op->oncommit_sync)
num_uncommitted.dec();
_session_op_remove(s, op);
s->lock.unlock();
@ -2997,23 +3005,28 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
num_unacked.dec();
logger->inc(l_osdc_op_ack);
}
if (op->oncommit && (m->is_ondisk() || rc)) {
ldout(cct, 15) << "handle_osd_op_reply safe" << dendl;
oncommit = op->oncommit;
op->oncommit = 0;
num_uncommitted.dec();
logger->inc(l_osdc_op_commit);
}
if (op->oncommit_sync) {
op->oncommit_sync->complete(rc);
op->oncommit_sync = NULL;
if (m->is_ondisk() || rc) {
if (op->oncommit) {
ldout(cct, 15) << "handle_osd_op_reply safe" << dendl;
oncommit = op->oncommit;
op->oncommit = NULL;
num_uncommitted.dec();
logger->inc(l_osdc_op_commit);
}
if (op->oncommit_sync) {
ldout(cct, 15) << "handle_osd_op_reply safe (sync)" << dendl;
op->oncommit_sync->complete(rc);
op->oncommit_sync = NULL;
num_uncommitted.dec();
logger->inc(l_osdc_op_commit);
}
}
/* get it before we call _finish_op() */
Mutex *completion_lock = (op->target.base_oid.name.size() ? s->get_lock(op->target.base_oid) : NULL);
// done with this tid?
if (!op->onack && !op->oncommit) {
if (!op->onack && !op->oncommit && !op->oncommit_sync) {
ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl;
_finish_op(op);
}