]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: Initialize pool and recovery_state in the order they are defined
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 2 May 2019 16:48:44 +0000 (12:48 -0400)
committerKefu Chai <kchai@redhat.com>
Fri, 21 Jun 2019 03:41:16 +0000 (11:41 +0800)
Currently we call get_pool on the PeeringState before the PeeringState
has been initialized.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index aa26a1863606461df9249349d342f69eca9a5cd4..a4b2c7d01800f158186b4a72179e5b3ed6bb538b 100644 (file)
@@ -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
index 1b425525b86c05ec8b6b7ec324184e210dc03ec1..f05e7036e9702999acaaeae63bdc091e779279db 100644 (file)
@@ -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;
 };