]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: perf counters might not be initialized on error 6523/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 10 Nov 2015 13:20:13 +0000 (08:20 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 10 Nov 2015 13:20:13 +0000 (08:20 -0500)
Fixes: #13740
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/ImageCtx.cc
src/librbd/internal.cc

index 50c0b0295edd86a55f03a4366bc82da48eee0d2a..68a03faffbd45f2822ea8438ee3819ed45f826ee 100644 (file)
@@ -108,7 +108,9 @@ public:
   }
 
   ImageCtx::~ImageCtx() {
-    perf_stop();
+    if (perfcounter) {
+      perf_stop();
+    }
     if (object_cacher) {
       delete object_cacher;
       object_cacher = NULL;
index da0c9bcf0d0fdf44ff581d68b5de13c3308ffd07..56eb7c5567c9b88c0dd388f7dae505d9107447e3 100644 (file)
@@ -2884,7 +2884,8 @@ reprotect_and_return_err:
     if (ictx->object_cacher) {
       r = ictx->shutdown_cache(); // implicitly flushes
     } else {
-      r = flush(ictx);
+      RWLock::RLocker owner_locker(ictx->owner_lock);
+      r = _flush(ictx);
     }
     if (r < 0) {
       lderr(ictx->cct) << "error flushing IO: " << cpp_strerror(r)