From: Casey Bodley Date: Tue, 24 Oct 2017 18:45:12 +0000 (-0400) Subject: rgw: BucketTrimWatcher checks handle in stop X-Git-Tag: v12.2.3~125^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6fc4c7a12345b59cf3e14546006bbe7941eb98a3;p=ceph.git rgw: BucketTrimWatcher checks handle in stop Signed-off-by: Casey Bodley (cherry picked from commit 6e4d9735036a68575696e53b6732e4680a0226d6) --- diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc index 80d8f2205f74..1314f7bf1a4f 100644 --- a/src/rgw/rgw_sync_log_trim.cc +++ b/src/rgw/rgw_sync_log_trim.cc @@ -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