]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: BucketTrimWatcher checks handle in stop
authorCasey Bodley <cbodley@redhat.com>
Tue, 24 Oct 2017 18:45:12 +0000 (14:45 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 10 Nov 2017 18:23:03 +0000 (13:23 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_sync_log_trim.cc

index 80d8f2205f74d57921955f42259e15bf077cd5d1..1314f7bf1a4f6b65b0169d55c101ba9dd7bff2fa 100644 (file)
@@ -295,8 +295,10 @@ class BucketTrimWatcher : public librados::WatchCtx2 {
 
   void stop()
   {
-    ref.ioctx.unwatch2(handle);
-    ref.ioctx.close();
+    if (handle) {
+      ref.ioctx.unwatch2(handle);
+      ref.ioctx.close();
+    }
   }
 
   /// respond to bucket trim notifications