]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: remove unneeded assert from unregister_watch()
authorJosh Durgin <jdurgin@redhat.com>
Thu, 5 Mar 2015 01:52:39 +0000 (17:52 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Thu, 5 Mar 2015 01:52:43 +0000 (17:52 -0800)
Calling this unconditionally in close_image() simplifies error
handling when open_image() fails due to an error like EPERM from
registering a watch.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/ImageWatcher.cc

index 3e0b522d246a86819c72769f4e6a1fa3a2712f9f..d4aa428efe9ace9c53a4ce4b47a0cb96010e19ce 100644 (file)
@@ -100,7 +100,6 @@ int ImageWatcher::unregister_watch() {
   int r = 0;
   {
     RWLock::WLocker l(m_watch_lock);
-    assert(m_watch_state != WATCH_STATE_UNREGISTERED);
     if (m_watch_state == WATCH_STATE_REGISTERED) {
       r = m_image_ctx.md_ctx.unwatch2(m_watch_handle);
     }