From f03a9db4d94d018c3492f86e4d4f51c49e8bbcee Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 3 Feb 2024 20:26:34 +0300 Subject: [PATCH] Fix OSD space reporting sometimes adding garbage zeros for deleted inodes (causing extra pool/stats etcd keys for deleted pools) --- src/osd_cluster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osd_cluster.cpp b/src/osd_cluster.cpp index 2ecee460..180bd880 100644 --- a/src/osd_cluster.cpp +++ b/src/osd_cluster.cpp @@ -262,7 +262,8 @@ void osd_t::report_statistics() for (auto st_it = inode_stats.begin(); st_it != inode_stats.end(); ) { auto & kv = *st_it; - if (!bs_inode_space[kv.first]) + auto spc_it = bs_inode_space.find(kv.first); + if (spc_it == bs_inode_space.end() || !spc_it->second) // prevent autovivification { // Is it an empty inode? if (!tv_now.tv_sec)