]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: rewatch complete callback should be invoked w/o lock
authorJason Dillaman <dillaman@redhat.com>
Fri, 6 Jan 2017 14:29:02 +0000 (09:29 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 9 Jan 2017 17:56:00 +0000 (12:56 -0500)
It's currently being incorrectly invoked twice -- but the direct
callback is holding the Watcher lock. This results in a recursive
lock when ManagedLock attempts to retrieve the watch id from the
Watcher.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/Watcher.cc

index 44ee24651e5c1512c69a897cf79290210ad0b53a..6b3af958fb79d426336df47dd4d6ac9ba88a667a 100644 (file)
@@ -199,10 +199,9 @@ void Watcher::handle_rewatch(int r) {
 
     std::swap(unregister_watch_ctx, m_unregister_watch_ctx);
 
-    handle_rewatch_complete(r);
     m_work_queue->queue(
-        create_context_callback<Watcher,
-                                &Watcher::handle_rewatch_complete>(this));
+      create_context_callback<Watcher,
+                              &Watcher::handle_rewatch_complete>(this), r);
   }
 
   // wake up pending unregister request