mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
Merge pull request #6064 from H3C/wip-rbd-bugfix1
Objecter: misc fix for segmentation fault. Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
14a36a20ff
@ -1333,7 +1333,7 @@ void Objecter::_check_op_pool_dne(Op *op, bool session_locked)
|
||||
if (!session_locked) {
|
||||
s->lock.get_write();
|
||||
}
|
||||
_finish_op(op);
|
||||
_finish_op(op, 0);
|
||||
if (!session_locked) {
|
||||
s->lock.unlock();
|
||||
}
|
||||
@ -2255,7 +2255,7 @@ int Objecter::op_cancel(OSDSession *s, ceph_tid_t tid, int r)
|
||||
op->oncommit_sync = NULL;
|
||||
}
|
||||
_op_cancel_map_check(op);
|
||||
_finish_op(op);
|
||||
_finish_op(op, r);
|
||||
s->lock.unlock();
|
||||
|
||||
return 0;
|
||||
@ -2789,10 +2789,10 @@ void Objecter::_cancel_linger_op(Op *op)
|
||||
num_uncommitted.dec();
|
||||
}
|
||||
|
||||
_finish_op(op);
|
||||
_finish_op(op, 0);
|
||||
}
|
||||
|
||||
void Objecter::_finish_op(Op *op)
|
||||
void Objecter::_finish_op(Op *op, int r)
|
||||
{
|
||||
ldout(cct, 15) << "finish_op " << op->tid << dendl;
|
||||
|
||||
@ -2801,7 +2801,7 @@ void Objecter::_finish_op(Op *op)
|
||||
if (!op->ctx_budgeted && op->budgeted)
|
||||
put_op_budget(op);
|
||||
|
||||
if (op->ontimeout) {
|
||||
if (op->ontimeout && r != -ETIMEDOUT) {
|
||||
Mutex::Locker l(timer_lock);
|
||||
timer.cancel_event(op->ontimeout);
|
||||
}
|
||||
@ -2830,7 +2830,7 @@ void Objecter::finish_op(OSDSession *session, ceph_tid_t tid)
|
||||
|
||||
Op *op = iter->second;
|
||||
|
||||
_finish_op(op);
|
||||
_finish_op(op, 0);
|
||||
}
|
||||
|
||||
MOSDOp *Objecter::_prepare_osd_op(Op *op)
|
||||
@ -3159,7 +3159,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
|
||||
// done with this tid?
|
||||
if (!op->onack && !op->oncommit && !op->oncommit_sync) {
|
||||
ldout(cct, 15) << "handle_osd_op_reply completed tid " << tid << dendl;
|
||||
_finish_op(op);
|
||||
_finish_op(op, 0);
|
||||
}
|
||||
|
||||
ldout(cct, 5) << num_unacked.read() << " unacked, " << num_uncommitted.read() << " uncommitted" << dendl;
|
||||
@ -3756,7 +3756,7 @@ void Objecter::handle_pool_op_reply(MPoolOpReply *m)
|
||||
}
|
||||
iter = pool_ops.find(tid);
|
||||
if (iter != pool_ops.end()) {
|
||||
_finish_pool_op(op);
|
||||
_finish_pool_op(op, 0);
|
||||
}
|
||||
} else {
|
||||
ldout(cct, 10) << "unknown request " << tid << dendl;
|
||||
@ -3785,17 +3785,17 @@ int Objecter::pool_op_cancel(ceph_tid_t tid, int r)
|
||||
if (op->onfinish)
|
||||
op->onfinish->complete(r);
|
||||
|
||||
_finish_pool_op(op);
|
||||
_finish_pool_op(op, r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Objecter::_finish_pool_op(PoolOp *op)
|
||||
void Objecter::_finish_pool_op(PoolOp *op, int r)
|
||||
{
|
||||
assert(rwlock.is_wlocked());
|
||||
pool_ops.erase(op->tid);
|
||||
logger->set(l_osdc_poolop_active, pool_ops.size());
|
||||
|
||||
if (op->ontimeout) {
|
||||
if (op->ontimeout && r != -ETIMEDOUT) {
|
||||
Mutex::Locker l(timer_lock);
|
||||
timer.cancel_event(op->ontimeout);
|
||||
}
|
||||
@ -3873,7 +3873,7 @@ void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m)
|
||||
last_seen_pgmap_version = m->version;
|
||||
}
|
||||
op->onfinish->complete(0);
|
||||
_finish_pool_stat_op(op);
|
||||
_finish_pool_stat_op(op, 0);
|
||||
} else {
|
||||
ldout(cct, 10) << "unknown request " << tid << dendl;
|
||||
}
|
||||
@ -3898,18 +3898,18 @@ int Objecter::pool_stat_op_cancel(ceph_tid_t tid, int r)
|
||||
PoolStatOp *op = it->second;
|
||||
if (op->onfinish)
|
||||
op->onfinish->complete(r);
|
||||
_finish_pool_stat_op(op);
|
||||
_finish_pool_stat_op(op, r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Objecter::_finish_pool_stat_op(PoolStatOp *op)
|
||||
void Objecter::_finish_pool_stat_op(PoolStatOp *op, int r)
|
||||
{
|
||||
assert(rwlock.is_wlocked());
|
||||
|
||||
poolstat_ops.erase(op->tid);
|
||||
logger->set(l_osdc_poolstat_active, poolstat_ops.size());
|
||||
|
||||
if (op->ontimeout) {
|
||||
if (op->ontimeout && r != -ETIMEDOUT) {
|
||||
Mutex::Locker l(timer_lock);
|
||||
timer.cancel_event(op->ontimeout);
|
||||
}
|
||||
@ -3980,7 +3980,7 @@ void Objecter::handle_fs_stats_reply(MStatfsReply *m)
|
||||
if (m->h.version > last_seen_pgmap_version)
|
||||
last_seen_pgmap_version = m->h.version;
|
||||
op->onfinish->complete(0);
|
||||
_finish_statfs_op(op);
|
||||
_finish_statfs_op(op, 0);
|
||||
} else {
|
||||
ldout(cct, 10) << "unknown request " << tid << dendl;
|
||||
}
|
||||
@ -4005,18 +4005,18 @@ int Objecter::statfs_op_cancel(ceph_tid_t tid, int r)
|
||||
StatfsOp *op = it->second;
|
||||
if (op->onfinish)
|
||||
op->onfinish->complete(r);
|
||||
_finish_statfs_op(op);
|
||||
_finish_statfs_op(op, r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Objecter::_finish_statfs_op(StatfsOp *op)
|
||||
void Objecter::_finish_statfs_op(StatfsOp *op, int r)
|
||||
{
|
||||
assert(rwlock.is_wlocked());
|
||||
|
||||
statfs_ops.erase(op->tid);
|
||||
logger->set(l_osdc_statfs_active, statfs_ops.size());
|
||||
|
||||
if (op->ontimeout) {
|
||||
if (op->ontimeout && r != -ETIMEDOUT) {
|
||||
Mutex::Locker l(timer_lock);
|
||||
timer.cancel_event(op->ontimeout);
|
||||
}
|
||||
@ -4582,7 +4582,7 @@ int Objecter::command_op_cancel(OSDSession *s, ceph_tid_t tid, int r)
|
||||
|
||||
CommandOp *op = it->second;
|
||||
_command_cancel_map_check(op);
|
||||
_finish_command(op, -ETIMEDOUT, "");
|
||||
_finish_command(op, r, "");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -4596,7 +4596,7 @@ void Objecter::_finish_command(CommandOp *c, int r, string rs)
|
||||
if (c->onfinish)
|
||||
c->onfinish->complete(r);
|
||||
|
||||
if (c->ontimeout) {
|
||||
if (c->ontimeout && r != -ETIMEDOUT) {
|
||||
Mutex::Locker l(timer_lock);
|
||||
timer.cancel_event(c->ontimeout);
|
||||
}
|
||||
|
@ -1768,7 +1768,7 @@ public:
|
||||
void _send_op_account(Op *op);
|
||||
void _cancel_linger_op(Op *op);
|
||||
void finish_op(OSDSession *session, ceph_tid_t tid);
|
||||
void _finish_op(Op *op);
|
||||
void _finish_op(Op *op, int r);
|
||||
static bool is_pg_changed(
|
||||
int oldprimary,
|
||||
const vector<int>& oldacting,
|
||||
@ -2511,7 +2511,7 @@ public:
|
||||
private:
|
||||
void pool_op_submit(PoolOp *op);
|
||||
void _pool_op_submit(PoolOp *op);
|
||||
void _finish_pool_op(PoolOp *op);
|
||||
void _finish_pool_op(PoolOp *op, int r);
|
||||
void _do_delete_pool(int64_t pool, Context *onfinish);
|
||||
public:
|
||||
int create_pool_snap(int64_t pool, string& snapName, Context *onfinish);
|
||||
@ -2537,7 +2537,7 @@ public:
|
||||
void get_pool_stats(list<string>& pools, map<string,pool_stat_t> *result,
|
||||
Context *onfinish);
|
||||
int pool_stat_op_cancel(ceph_tid_t tid, int r);
|
||||
void _finish_pool_stat_op(PoolStatOp *op);
|
||||
void _finish_pool_stat_op(PoolStatOp *op, int r);
|
||||
|
||||
// ---------------------------
|
||||
// df stats
|
||||
@ -2547,7 +2547,7 @@ public:
|
||||
void handle_fs_stats_reply(MStatfsReply *m);
|
||||
void get_fs_stats(struct ceph_statfs& result, Context *onfinish);
|
||||
int statfs_op_cancel(ceph_tid_t tid, int r);
|
||||
void _finish_statfs_op(StatfsOp *op);
|
||||
void _finish_statfs_op(StatfsOp *op, int r);
|
||||
|
||||
// ---------------------------
|
||||
// some scatter/gather hackery
|
||||
|
Loading…
Reference in New Issue
Block a user