]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_rados_watch_notify: do not unwatch on invalid handle
authorSage Weil <sage@redhat.com>
Tue, 18 Nov 2014 00:20:49 +0000 (16:20 -0800)
committerSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 18:37:22 +0000 (10:37 -0800)
It is not safe to call rados_unwatch on an undefined handle.

Signed-off-by: Sage Weil <sage@redhat.com>
src/test/system/st_rados_watch.cc

index ba58e474ade1451a17327fd26df88b8d69ccb078..7f837f532b0ebaf64a22f2f8446e4400970ffc44 100644 (file)
@@ -91,7 +91,8 @@ run()
     r = 1;
   }
 
-  rados_unwatch(io_ctx, m_obj_name.c_str(), handle);
+  if (m_watch_retcode == 0)
+    rados_unwatch(io_ctx, m_obj_name.c_str(), handle);
   rados_ioctx_destroy(io_ctx);
   rados_shutdown(cl);