]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set per_pool_stats true when OSD has no PG 48250/head
authorlmgdlmgd <jindengke@inspur.com>
Tue, 6 Sep 2022 07:32:54 +0000 (15:32 +0800)
committerIgor Fedotov <igor.fedotov@croit.io>
Mon, 26 Sep 2022 09:37:50 +0000 (12:37 +0300)
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>
(cherry picked from commit c5b4e53e29ed8f2b6e0bad29754964b958e8240e)

src/osd/OSD.cc

index 45470ad8c703482aa23fc4835a34b7e8d8ad2fee..82c3e1512051ba640b0bc586e92beee58913d42c 100644 (file)
@@ -7796,16 +7796,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;
     }
   }