From 6248c40d542e08cb9a7dd8a4399c44110b334f23 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 2 May 2019 12:48:44 -0400 Subject: [PATCH] OSD: Initialize pool and recovery_state in the order they are defined Currently we call get_pool on the PeeringState before the PeeringState has been initialized. Signed-off-by: Adam C. Emerson --- src/osd/PG.cc | 2 +- src/osd/PG.h | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index aa26a186360..a4b2c7d0180 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -176,7 +176,6 @@ PG::PG(OSDService *o, OSDMapRef curmap, coll(p), osd(o), cct(o->cct), - pool(recovery_state.get_pool()), osdriver(osd->store, coll_t(), OSD::make_snapmapper_oid()), snap_mapper( cct, @@ -208,6 +207,7 @@ PG::PG(OSDService *o, OSDMapRef curmap, curmap, this, this), + pool(recovery_state.get_pool()), info(recovery_state.get_info()) { #ifdef PG_DEBUG_REFS diff --git a/src/osd/PG.h b/src/osd/PG.h index 1b425525b86..f05e7036e97 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -595,8 +595,6 @@ public: protected: CephContext *cct; - const PGPool &pool; - // locking and reference counting. // I destroy myself when the reference count hits zero. // lock() should be called before doing anything. @@ -1488,9 +1486,10 @@ protected: protected: PeeringState recovery_state; - /** - * Ref to pg_info_t in Peering state - */ + // ref to recovery_state.pool + const PGPool &pool; + + // ref to recovery_state.info const pg_info_t &info; }; -- 2.39.5