From: Sage Weil Date: Fri, 21 Nov 2014 21:50:58 +0000 (-0800) Subject: osdc/Objecter: queued_async() gets called inside watch_lock from caller X-Git-Tag: v0.91~77 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fa05dbf4ac849ca3d3b2d48abcdecb539dd050d;p=ceph.git osdc/Objecter: queued_async() gets called inside watch_lock from caller Signed-off-by: Sage Weil --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index d32f660fef81..fc2c67441ef1 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -495,7 +495,7 @@ struct C_DoWatchError : public Context { int err; C_DoWatchError(Objecter::LingerOp *i, int r) : info(i), err(r) { info->get(); - info->queued_async(); + info->_queued_async(); } void finish(int r) { info->watch_context->handle_error(info->linger_id, err); @@ -730,7 +730,7 @@ struct C_DoWatchNotify : public Context { C_DoWatchNotify(Objecter *o, Objecter::LingerOp *i, MWatchNotify *m) : objecter(o), info(i), msg(m) { info->get(); - info->queued_async(); + info->_queued_async(); msg->get(); } void finish(int r) { @@ -750,8 +750,8 @@ void Objecter::handle_watch_notify(MWatchNotify *m) ldout(cct, 7) << __func__ << " cookie " << m->cookie << " dne" << dendl; return; } + RWLock::WLocker wl(info->watch_lock); if (m->opcode == CEPH_WATCH_EVENT_DISCONNECT) { - RWLock::WLocker l(info->watch_lock); info->last_error = -ENOTCONN; } finisher->queue(new C_DoWatchNotify(this, info, m)); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index f7006ec4fb0e..ba23f1b588c8 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1497,8 +1497,8 @@ public: ceph_tid_t ping_tid; epoch_t map_dne_bound; - void queued_async() { - RWLock::WLocker l(watch_lock); + void _queued_async() { + assert(watch_lock.is_locked()); watch_pending_async.push_back(ceph_clock_now(NULL)); } void finished_async() {