]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: queued_async() gets called inside watch_lock from caller
authorSage Weil <sage@redhat.com>
Fri, 21 Nov 2014 21:50:58 +0000 (13:50 -0800)
committerSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 18:39:20 +0000 (10:39 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index d32f660fef812ebe7f85145be11da8b757c8ec2c..fc2c67441ef13fb1951369f3c32c475336c40111 100644 (file)
@@ -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));
index f7006ec4fb0e0ebcacc0e06e623d565443c470ff..ba23f1b588c87aba7bd2a5c016058a1a9a7247fc 100644 (file)
@@ -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() {