]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: set per_pool_stats true when OSD has no PG
authorlmgdlmgd <jindengke@inspur.com>
Tue, 6 Sep 2022 07:32:54 +0000 (15:32 +0800)
committerGitHub <noreply@github.com>
Tue, 6 Sep 2022 07:32:54 +0000 (15:32 +0800)
if per_pool_stats is false when OSD has no PG, osd_sum.num_osds not equals osd_sum.num_per_pool_osds, then ceph df command return STORED == USED, this is not our expectation

Signed-off-by: jindengke <jindengke@inspur.com>
Signed-off-by: lmgdlmgd <jindengke@inspur.com>
src/osd/OSD.cc

index 4e457cacc667cd0b9d6b18964cf40dcfb986b6bc..af3003db0316bcca86fcf7c1753ca3d783c6fd0f 100644 (file)
@@ -7559,16 +7559,16 @@ MPGStats* OSD::collect_pg_stats()
       });
   }
   store_statfs_t st;
-  bool per_pool_stats = false;
+  bool per_pool_stats = true;
   bool per_pool_omap_stats = false;
   for (auto p : pool_set) {
     int r = store->pool_statfs(p, &st, &per_pool_omap_stats);
     if (r == -ENOTSUP) {
+      per_pool_stats = false;
       break;
     } else {
       assert(r >= 0);
       m->pool_stat[p] = st;
-      per_pool_stats = true;
     }
   }