]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix trivial bug 6517/head
authorLi Wang <li.wang@kylin-cloud.com>
Tue, 10 Nov 2015 08:21:54 +0000 (16:21 +0800)
committerLi Wang <li.wang@kylin-cloud.com>
Tue, 10 Nov 2015 08:32:14 +0000 (16:32 +0800)
Signed-off-by: Li Wang <li.wang@kylin-cloud.com>
Reported-by: Jie Wang <jie.wang@kylin-cloud.com>
src/osd/PG.cc

index 8a50060e61790328bab2b6b9e24b8bd3ba5b713b..0265eb25c9f90c2c8fde2878bfee949e568d57aa 100644 (file)
@@ -2525,7 +2525,6 @@ void PG::publish_stats_to_osd()
 
   utime_t now = ceph_clock_now(cct);
   if (info.stats.state != state) {
-    info.stats.state = state;
     info.stats.last_change = now;
     if ((state & PG_STATE_ACTIVE) &&
        !(info.stats.state & PG_STATE_ACTIVE))
@@ -2533,6 +2532,7 @@ void PG::publish_stats_to_osd()
     if ((state & (PG_STATE_ACTIVE|PG_STATE_PEERED)) &&
        !(info.stats.state & (PG_STATE_ACTIVE|PG_STATE_PEERED)))
       info.stats.last_became_peered = now;
+    info.stats.state = state;
   }
 
   _update_calc_stats();