]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set per_pool_stats true when OSD has no PG 48249/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:36:17 +0000 (12:36 +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 a21b04a688db063601d40a786af63e2b2c12e0a9..d39088e268b1f7dbf492c6e428cc39cb059331c9 100644 (file)
@@ -7694,16 +7694,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;
     }
   }