From: Mykola Golub Date: Sat, 7 Nov 2015 19:49:56 +0000 (+0200) Subject: librbd: start perf counters after id is initialized X-Git-Tag: v10.0.1~121^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F6494%2Fhead;p=ceph.git librbd: start perf counters after id is initialized So the perf counters section name has non-empty id. Fixes: #13720 Signed-off-by: Mykola Golub --- diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 9090d368d453..031893c6e36d 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -131,14 +131,6 @@ public: int ImageCtx::init() { int r; - string pname = string("librbd-") + id + string("-") + - data_ctx.get_pool_name() + string("/") + name; - if (!snap_name.empty()) { - pname += "@"; - pname += snap_name; - } - - perf_start(pname); if (id.length()) { old_format = false; @@ -184,6 +176,15 @@ public: header_oid = old_header_name(name); } + string pname = string("librbd-") + id + string("-") + + data_ctx.get_pool_name() + string("/") + name; + if (!snap_name.empty()) { + pname += "@"; + pname += snap_name; + } + + perf_start(pname); + if (cache) { Mutex::Locker l(cache_lock); ldout(cct, 20) << "enabling caching..." << dendl;