]> git-server-git.apps.pok.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>
Tue, 23 Jan 2018 15:19:12 +0000 (10:19 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 6e4d9735036a68575696e53b6732e4680a0226d6)

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