]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: always initialize perf counters 4406/head
authorJosh Durgin <jdurgin@redhat.com>
Mon, 20 Apr 2015 18:32:13 +0000 (11:32 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Mon, 20 Apr 2015 18:34:31 +0000 (11:34 -0700)
If ImageCtx::init() fails, perf counters are still used when closing
the image. To prevent uninitialized use, it's easiest to always
initialize them before anything that can fail in ImageCtx::init().

This was moved in 6055df398557e4dbcabc66f463a0a126f9b5dc74, but it's
not necessary to delay perf counter initialization for any extra
configuration.

Fixes: #11433
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/librbd/ImageCtx.cc

index 92317de785189510aa6ba6fdcb673b06ac13616e..5f9ba89546e21574a2ec390b29a180f1d20a41d7 100644 (file)
@@ -108,6 +108,8 @@ namespace librbd {
       pname += snap_name;
     }
 
+    perf_start(pname);
+
     if (id.length()) {
       old_format = false;
     } else {
@@ -189,7 +191,6 @@ namespace librbd {
     readahead.set_trigger_requests(readahead_trigger_requests);
     readahead.set_max_readahead_size(readahead_max_bytes);
 
-    perf_start(pname);
     return 0;
   }