]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_test_stress_watch: do not unwatch if watch failed
authorSage Weil <sage@redhat.com>
Sun, 14 Dec 2014 05:40:21 +0000 (21:40 -0800)
committerSage Weil <sage@redhat.com>
Sun, 14 Dec 2014 05:40:21 +0000 (21:40 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/test/test_stress_watch.cc

index c9813e698f54a1015218de776fb1d6e0fc8345cc..168714bba28ac6db3cfc6393e37869263bcb8fa5 100644 (file)
@@ -51,9 +51,10 @@ struct WatcherUnwatcher : public Thread {
 
       uint64_t handle;
       WatchNotifyTestCtx watch_ctx;
-      ioctx.watch("foo", 0, &handle, &watch_ctx);
+      int r = ioctx.watch("foo", 0, &handle, &watch_ctx);
       bufferlist bl;
-      ioctx.unwatch("foo", handle);
+      if (r == 0)
+       ioctx.unwatch("foo", handle);
       ioctx.close();
     }
     return NULL;